hw3solution

hw3solution - assign imm5={{11{ir[4]}}, ir[4:0]} a...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 module ALU(aluin1, aluin2, alu_control, aluout, alucarry) input [15:0] aluin1, aluin2 input [1:0] alu_control output [15:0] aluout output alucarry reg [15:0] aluout reg alucarry always @(aluin1 or aluin2 or alu_control) case(alu_control) 0: {alucarry,aluout}=aluin1+aluin2 2: {alucarry,aluout}={1'b0, ~aluin1} default: {alucarry,aluout}=17'h0 endcase endmodule ------------------------------------------------ module extension(ir, trapvect8, offset11, offset9, offset6, imm5) input [15:0] ir
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 Page 2 output [15:0] trapvect8, offset11, offset9, offset6, imm5 assign trapvect8={{8{ir[7]}}, ir[7:0]} assign offset11={{5{ir[10]}}, ir[10:0]} assign offset9 ={{7{ir[8]}}, ir[8:0]} assign offset6={{10{ir[5]}}, ir[5:0]}
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: assign imm5={{11{ir[4]}}, ir[4:0]} a endmodule /* problem 3 answer: A controller should contain a module that is able to read programs, a module that is able to understand each instruction, a module that is able to perform all the computations, a module that stores temporary results, a module that is able to write data into memories or any other devices beyond the micro-controller. */ Sheet1 Page 3 // overflow not implemented Sheet1 Page 4 //ir[7] repeated 8 times for total of 16 bits //ir[7] repeated 5 times for total of 16 bits //ir[7] repeated 7 times for total of 16 bits //ir[7] repeated 10 times for total of 16 bits //ir[7] repeated 11 times for total of 16 bits...
View Full Document

This note was uploaded on 03/30/2009 for the course ECE 406 taught by Professor Davis during the Spring '08 term at N.C. State.

Page1 / 4

hw3solution - assign imm5={{11{ir[4]}}, ir[4:0]} a...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online