T
Tadeu
Guest
Hi I am working in a university project trying to build a 4Bits ALU I
am havaing problems with this:
/***************************************/
module Logic(a, b, s, f);
input [0:3] a,b;
input [0:1] s;
output [0:3] f;
case(s)
2'b00 : begin//AND
assign f[0] = a[0] & b[0];
assign f[1] = a[1] & b[1];
assign f[2] = a[2] & b[2];
assign f[3] = a[3] & b[3];
end
2'b01 : begin//OR
assign f[0] = a[0] | b[0];
assign f[1] = a[1] | b[1];
assign f[2] = a[2] | b[2];
assign f[3] = a[3] | b[3];
end
default: begin
end
endcase
endmodule
/***************************************/
verilog always return:
///////////////
and.v:99: parse error
and.v:101: error: invalid module item. Did you forget an initial or
always?
and.v:105: parse error
and.v:107: error: invalid module item. Did you forget an initial or
always?
and.v:111: parse error
and.v:120: error: invalid module item. Did you forget an initial or
always?
/////////////
where line 99 is the "case(s)"
Any sugestions?
am havaing problems with this:
/***************************************/
module Logic(a, b, s, f);
input [0:3] a,b;
input [0:1] s;
output [0:3] f;
case(s)
2'b00 : begin//AND
assign f[0] = a[0] & b[0];
assign f[1] = a[1] & b[1];
assign f[2] = a[2] & b[2];
assign f[3] = a[3] & b[3];
end
2'b01 : begin//OR
assign f[0] = a[0] | b[0];
assign f[1] = a[1] | b[1];
assign f[2] = a[2] | b[2];
assign f[3] = a[3] | b[3];
end
default: begin
end
endcase
endmodule
/***************************************/
verilog always return:
///////////////
and.v:99: parse error
and.v:101: error: invalid module item. Did you forget an initial or
always?
and.v:105: parse error
and.v:107: error: invalid module item. Did you forget an initial or
always?
and.v:111: parse error
and.v:120: error: invalid module item. Did you forget an initial or
always?
/////////////
where line 99 is the "case(s)"
Any sugestions?