Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Remove padded bytes of zeros

Status
Not open for further replies.

rac70

Newbie level 6
Joined
Jan 7, 2015
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
114
Hi all,
how to remove the extra padded bytes of zeros when every time the bytes of zeros padded may lie b/w 1 to 16 suggest any logic?
 

It seems like you are returning to the topic Different widths of data on same bus.

For one thing changing the width is not possible either in simulation or in hardware a bus is a fixed size vector of bits that can't be modified during run time. The width is defined and fixed at elaboration.

So instead of asking how to implement something you came up with that can't be done, why don't you instead state what your requirements are and then ask how it could be done.
 

You could send the data through a state machine, when you see a byte of zero's then you could EITHER switch the mux & essentially drop the data OR just have an enable pin for data valid


Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
if rising_edge(clock) then
 
  data_valid<= '0';
 
  case state
    when sniffing=>
      if data_byte = (others=>'0') then
        mux_sel = '1';
      else
        mux_sel = '0';
        mux_data_in0 <= data_byte;
        data_valid <= '1';
        state <= tx;
      end if;
    when tx =>
      if rx = '1' then
        state <= sniffing;
     end if;
  end case;
...
 
..
if data_valid = '1' then
   data_in <= data_byte;
   rx          <= '1';
end if;

 

I wonder how you can give a solution for an essentially unspecified problem.

I think the present state of this thread is "waiting for better question" respectively a clear one.

Unless a special coding is assumed, a data byte can be zero, so how do you distinguish it from a padded byte?
 

I see what you mean by valid data being zero's.

I also see what you mean, the question is unclear.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top