Lec2
Lec2
// da flow level
module dflow (o, a, b);
// I/O ports
endmodule
output reg q;
endmodule
// IO
assign s = a ^ b;
assign c = a & b;
endmodule
// IO
wire s1, c1, c2;
ha ha1 (s1_reg, c1, a, b);
ha ha2 (.a(s1_reg), .b(cin), .s(s) , .c(c2) );
assign c = c1 || c2;
endmodule
// Instantiate the module
led instance_name (
.out(out),
.in(in)
);
initial begin
memory [0] = 32'b000000_00001_00010_00011_000000_00010; //add $1, $2,
$3
memory [1] = 32'd45;
memory [2] = 32'd6969;
end
always@(address)
instruction <= memory [address];
endmodule
initial begin
memory [0] = 32'b000000_00001_00010_00011_000000_00010; //add $1, $2,
$3
memory [1] = 32'd45;
memory [2] = 32'd6969;
end
//always@(address)
// data <= memory [address];
assign data_out = memory [address];
endmodule
module reg_file (rdata1, rdata2, rs1, rs2, rd, write_data, rst, clk, mem_write);
endcase
parameter N = 32;
else
pc_out <= pc_out + 1;
end // ???
end
endmodule