the decoder code is showing error and non synthesizable- ERROR - sel is not a constant module Simple_decoder_1_to_4(in,sel,out); input in; input [0:1]sel; output [0:3] out; assign out[sel]=in; // when LHS is variable we get a decoder endmodule
"assign" statement is always active, that is, whenever the values of RHS operands changes, the new value of LHS is evaluated and updated on the net. But in the code explain by the professor, the LHS has a variable on the LHS which is illegal according to the above definition of assign statement. Thus, the code can be modified as below module generate_decoder (out,in,sel); input in; input [1:0]sel; output reg [3:0]out; always@(in,sel) begin out[sel] = in; end endmodule In the above code, "out[sel] = in;" is synthesized as decoder as explained the professor.
Can anyone help on the following !!! The decoder code is showing error and non synthesizable- ERROR - sel is not a constant module Simple_decoder_1_to_4(in,sel,out); input in; input [0:1]sel; output [0:3] out; assign out[sel]=in; // when LHS is variable we get a decoder endmodule
"assign" statement is always active, that is, whenever the values of RHS operands changes, the new value of LHS is evaluated and updated on the net. But in the code explain by the professor, the LHS has a variable on the LHS which is illegal according to the above definition of assign statement. Thus, the code can be modified as below module generate_decoder (out,in,sel); input in; input [1:0]sel; output reg [3:0]out; always@(in,sel) begin out[sel] = in; end endmodule In the above code, "out[sel] = in;" is synthesized as decoder as explained the professor.
Thank you, correct me if I'm wrong I think in 19:23 this is a Demux not a decoder since we have a selector
when input is only 1 in decoder it will become de mux
in NAND LATCH it is active low and s is at top and in its front there is q and in front of R there should be q_bar
yes, you're right
the decoder code is showing error and non synthesizable- ERROR - sel is not a constant
module Simple_decoder_1_to_4(in,sel,out);
input in;
input [0:1]sel;
output [0:3] out;
assign out[sel]=in; // when LHS is variable we get a decoder
endmodule
you used 3 variables but declared 2 variables. that might cause an error
@@arghya.7098 he declared all the variables ig
"assign" statement is always active, that is, whenever the values of RHS operands changes, the new value of LHS is evaluated and updated on the net.
But in the code explain by the professor, the LHS has a variable on the LHS which is illegal according to the above definition of assign statement.
Thus, the code can be modified as below
module generate_decoder (out,in,sel);
input in;
input [1:0]sel;
output reg [3:0]out;
always@(in,sel)
begin
out[sel] = in;
end
endmodule
In the above code, "out[sel] = in;" is synthesized as decoder as explained the professor.
@@murugeshwarana2427 Thank you. Your ans really helped.
Isn't that decoder a dmux ??
i guess he mistakenly told demux and decoder as same thing
Best book for Verilog????
guys,does anyone know ho to get the slides which prof explain?
Why reg is not used ?
Y
Can anyone help on the following !!!
The decoder code is showing error and non synthesizable- ERROR - sel is not a constant
module Simple_decoder_1_to_4(in,sel,out);
input in;
input [0:1]sel;
output [0:3] out;
assign out[sel]=in; // when LHS is variable we get a decoder
endmodule
but decoder ckt will not having selection line
you used 3 variables but declared 2 variables. that might cause an error
"assign" statement is always active, that is, whenever the values of RHS operands changes, the new value of LHS is evaluated and updated on the net.
But in the code explain by the professor, the LHS has a variable on the LHS which is illegal according to the above definition of assign statement.
Thus, the code can be modified as below
module generate_decoder (out,in,sel);
input in;
input [1:0]sel;
output reg [3:0]out;
always@(in,sel)
begin
out[sel] = in;
end
endmodule
In the above code, "out[sel] = in;" is synthesized as decoder as explained the professor.