Ajinkya Bobade
Newbie level 2
i need some help for college hw which is as follows
Q) 1. Build a serial de-multiplexer unit in Verilog. Inputs to the demux unit: Input clk, Input NewPacket, Input [7:0] DataIn
Data comes in through the input port of variable length upto a maximum of 8 bytes. The Newpacket signal indicates arrival of new data packet during the current clock cyles. The first 4 bits(LSB) of DataIn during the first clock cycle indicates packet-size and the last 4 bits (MSB) indicates the initial output channel to select. The successive inputs are actual data packets that need to be routed. The output is routed starting from initial channel to successive output channels till the size of the packet.
Output Signals, 8 output channels of 8 bits each: Output [7:0] DataOut0, DataOut1, DataOut2, DataOut3, DataOut4, DataOut5, DataOut6, DataOut7
i have done the following code:
but its giving behavioural syntax error, please help
Q) 1. Build a serial de-multiplexer unit in Verilog. Inputs to the demux unit: Input clk, Input NewPacket, Input [7:0] DataIn
Data comes in through the input port of variable length upto a maximum of 8 bytes. The Newpacket signal indicates arrival of new data packet during the current clock cyles. The first 4 bits(LSB) of DataIn during the first clock cycle indicates packet-size and the last 4 bits (MSB) indicates the initial output channel to select. The successive inputs are actual data packets that need to be routed. The output is routed starting from initial channel to successive output channels till the size of the packet.
Output Signals, 8 output channels of 8 bits each: Output [7:0] DataOut0, DataOut1, DataOut2, DataOut3, DataOut4, DataOut5, DataOut6, DataOut7
Code:
Sample Input and output for the system is shown below
Clock: 0 10 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
DataIn: 0 73 11 22 33 44 00 02 88 99
NewPack: 0 1 0 0 0 0 0 1 0 0
Dataout0: 0 00 00 00 22 00 00 00 00 88 00 00
Dataout1: 0 00 00 00 00 33 00 00 00 00 99 00
Dataout2: 0 00 00 00 00 00 00 00 00 00 00 00
Dataout3: 0 00 00 00 00 00 00 00 00 00 00 00
Dataout4: 0 00 00 00 00 00 00 00 00 00 00 00
Dataout5: 0 00 00 00 00 00 00 00 00 00 00 00
Dataout6: 0 00 00 00 00 00 00 00 00 00 00 00
Dataout7: 0 00 00 11 00 00 00 00 00 00 00 00
i have done the following code:
Code Verilog - [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 27 28 module demux(DataIn,Initch,packsize,newpack,DataOut); input [7:0] DataIn; output [7:0] DataOut; input newpack; //wiring all inputs wire newpack; reg[7:0] DataIn; reg[7:0]DataOut; always @(posedge clk) // when positive edge is one begin:demux if (newpack == 1'b1) begin // when newpack is 1 assign Initch=DataIn[4:7]; assign Packsize=DataIn[0:3]; assign active=1; assign CurrentCh=Initch; for (i=0; i<=7; i=i+1) begin // for next column to be zero as in figure1 DataOut[i]= 0; end DataOut[CurrentCh]=DataIn; CurrentCh=CurrentCh+1; end
but its giving behavioural syntax error, please help
Last edited by a moderator: