Professional Documents
Culture Documents
Pvlsi PDF
Pvlsi PDF
Pvlsi PDF
if ( M == 1) if ( I[j] == 1 )
case ( F ) C = j;
0:f=a&b; end
1:f=a|b; end
2:f=a^b;//xor endmodule
0:{cout,f}=a; integer k;
5:{cout,f}=a-b; end
6:{cout,f}=~a+b; endmodule
if ( A < B ) begin
X = 1;
Y = 0; output reg [7:0] Y;
end if ( EN == 1 )
else if ( A == B ) begin Y = 0;
X = 0; else begin
Y = 1; A = 0;
Z = 0; B = 0;
end C = 0;
else begin Y = 0;
X = 0; case ( )
Y = 0; endcase
Z = 1; end
end end
endmodule
end Demultiplexor
initial begin Y = 0;
#0 A=2; B=3; if ( E == 0 )
end endmodule
endmodule end
result=result-1; endmodule
module mux_4_1 ( E, D, S, Y );
terminal_count=1;
input E;
else terminal_count=0;
input [1:0] S;
end
input [3:0] D;
end
output reg Y;
endmodule
integer i; reg A, B, Sel;
reg E; endmodule
IN = 8'b11110000;
SEL = 1;
end
endmodule
RAM
module raam8x3(data,adresa,clk,oe,we,dout);
input clk,oe,we;
if(oe==1)
dout=3'bz;
else
if(we==1)
memorie[adresa]=dout;
else
dout=memorie[adresa];
end
endmodule