

































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
These are the Lecture Slides of Computer Organization which includes Format, Administrative Matters, Operations, Branching, Calling Conventions, Instruction Set Design, Data Type and Size, Successor Instruction, General Purpose Register etc. Key important points are: v
Typology: Slides
1 / 41
This page cannot be seen from the preview
Don't miss anything!


































"To Design is to Represent"
Architectural Simulation
Functional/Behavioral
Register Transfer
Logic
Circuit
ļ§ Goals:
ļ§ Concepts:
Module/Design Entity ==
Interface == External
Architecture (Body ) ==
ļ§ Operators borrowed from C programming language
= < <= ! && ||
== != ?: {} % === !== ~ & | << >>
Arithmetic Relational Logical Logical equality Conditional Concatenate Modulus Case equality Bit-wise Shift
ļ§ Unlike conventional programs, not a serial model of execution
ļ§ Global variable designates simulation time
module repeat_loop (clock); input clock; initial begin repeat (5) @(posedge clock); $stop; end endmodule
Initial: execute at start of sim Wait for 5 positive clock edges Stop simulation
Synchronous: #expression ā suspend execution for indicated time Asynchronous: @expression ā suspend execution until event occurs Level: wait (expression) ā suspend execution until expression true
module time_control; reg[1:0] r; initial #70 $stop; initial begin : b1 //named block b #10 r = 1; //wait for 10 time units #20 r = 1; //wait for 20 time units #30 r = 1; //wait for 30 time units end initial begin : b2 //named block b #5 r = 2; //wait for 5 time units #20 r = 2; //wait for 20 time units #30 r = 2; //wait for 30 time units end always @r begin $display (ār= %0d at time %0dā, r, $time); end endmodule
add add $1,$2,$3 $1 = $2 + $3 3 operands; exception possible subtract sub $1,$2,$3 $1 = $2 ā $3 3 operands; exception possible add immediate addi $1,$2,100 $1 = $2 + 100 + constant; exception possible add unsigned addu $1,$2,$3 $1 = $2 + $3 3 operands; no exceptions subtract unsigned subu $1,$2,$3 $1 = $2 ā $3 3 operands; no exceptions add imm. unsign. addiu $1,$2,100 $1 = $2 + 100 + constant; no exceptions multiply mult $2,$3 Hi, Lo = $2 x $3 64-bit signed product multiply unsigned multu$2,$3 Hi, Lo = $2 x $3 64-bit unsigned product divide div $2,$3 Lo = $2 Ć· $3, Lo = quotient, Hi = remainder Hi = $2 mod $ divide unsigned divu $2,$3 Lo = $2 Ć· $3, Unsigned quotient & remainder Hi = $2 mod $ Move from Hi mfhi $1 $1 = Hi Used to get copy of Hi Move from Lo mflo $1 $1 = Lo Used to get copy of Lo
ļ§ Paper and pencil example (unsigned):
Multiplicand 1000 Multiplier 1001 1000 0000 0000 1000 Product 01001000
ļ§ m bits x n bits = m+n bit product
ļ§ Binary makes it easy:
ļ§ Four versions of multiply hardware & algorithm:
ļ§ Add Columns first,
then rows!
ļ§ Can be used to
reduce critical path of multiply
ļ§ Example: 53 bit
multiply (for floating point):
Carry Save Adder3=>
I 1 I (^2)
S 1 S (^0)
I (^3) Carry Save Adder3=>
I 1 I (^2)
S 1 S (^0)
I (^3) Carry Save Adder3=>
I 1 I (^2)
S 1 S (^0)
I (^3)
0
C 2
Carry Save Adder3=>
I 1 I (^2)
S 1 S (^0)
I (^3) Carry Save Adder3=>
I 1 I (^2)
S 1 S (^0)
I (^3) Carry Save Adder3=>
I 1 I (^2)
S 1 S (^0)
I (^3)
S 4 S 3 S 2 S 1 S 0
Carry Save Adder3=>
I 1 I (^2)
S 1 S (^0)
I (^3) Carry Save Adder3=>
I 1 I (^2)
S 1 S (^0)
I (^3)
0
Carry Save Adder3=>
I 1 I (^2)
S 1 S (^0)
I (^3)
B 2 A 2 C 1 B 1 A 1 C 0 B 0 A 0
D 2 D 1 D 0
ļ§ At each stage shift A left ( x 2)
ļ§ Use next bit of B to determine whether to add in shifted multiplicand
ļ§ Accumulate 2n bit partial product at each stage
B 0
A 3 A 2 A 1 A 0
A 3 A 2 A 1 A 0
A 3 A 2 A 1 A 0
A 3 A 2 A 1 A 0
B 1
B 2
B 3
P 7 P 6 P 5 P 4 P 3 P 2 P 1 P 0
0 0 0 0 0 0 0
No: < 32 repetitions
32nd repetition?