Академический Документы
Профессиональный Документы
Культура Документы
operations
Booth Multiplier
Division-
Basic division algorithm
Digit Recurrence Algorithm
Restoring Division
Non-Restoring Division
SRT Division (Sweeney, Robertson, and Tocher)
Multiplicative Algorithm
Approximation Algorithms
CORDIC Algorithm
Continued Product Algorithm
Useful site
http://www.ecs.umass.edu/ece/koren/arith/simulator
Definition and notations
Restoring division
Put x in register A, d in register B, 0 in register P, and perform n divide
steps (n is the quotient word length)
Shift 0 0 0 1 0 0 0 0 1
Subtract 1 1 1 0 1 0 0 1
Set q0 1 1 1 1 1
Fourth cycle
Restore 1 1
0 0 0 1 0 0 0 1 0
Remainder Quotient
7
Restoring division
-3 -3
Non Restoring division
Non-restoring division (contd..)
Initially0 0 0 0 0 1 0 0 0
0 0 0 1 1
Shift 0 0 0 0 1 0 0 0 First cycle
Subtract 1 1 1 0 1
Set q0 1 1 1 1 0 0 0 0 0
Shift 1 1 1 0 0 0 0 0
Add 0 0 0 1 1 Second cycle
10 Set q0 1 1 1 1 1 0 0 0 0
11 1000
11 Shift 1 1 1 1 0 0 0 0
10 Add 0 0 0 1 1 Third cycle
Set q0 0 0 0 0 1 0 0 0 1
Shift 0 0 0 1 0 0 0 1
Subtract 1 1 1 0 1 Fourth cycle
Set q0 1 1 1 1 1 0 0 1 0
Quotient
1 1 1 1 1
Add 0 0 0 1 1 Restore
0 0 0 1 0 remainder
Remainder
10
Non Restoring division
-3
-3-
Basic Architecture
Control unit and Processor
datapath Control unit Datapath
ALU
Controller Control +1
ALU operation /Status
ALU
Controller Control
Instruction cycle broken into /Status
several sub-operations, each one
clock cycle, e.g.: Registers
Fetch: Get next instruction into IR
Decode: Determine what the
instruction means
Fetch operands: Move data from PC IR R0 R1
memory to datapath register
Execute: Move data through the
ALU I/O
Store results: Write data from 100 load R0, M[500] Memory
...
register to memory 500 10
101 inc R1, R0 501
102 store M[501], R1 ...
compute
jump/branch
targets
+4
addr
PC control din dout
memory
extend
new
forward
pc detect
unit
hazard
Instruction Instruction Write-
Fetch Decode Execute Memory Back
IF/ID ID/EX EX/MEM MEM/WB
C int x = 10;
compiler x = 2 * x + 15;
r0 = 0
MIPS
addi r5, r0, 10 r5 = r0 + 10
assembly muli r5, r5, 2 r5 = r5<<1 #r5 = r5 * 2
assembler addi r5, r5, 15 r5 = r15 + 15
op = addi r0 r5 10
machine 00100000000001010000000000001010
code 00000000000001010010100001000000
00100000101001010000000000001111
op = addi r5 r5 15
CPU
op = r-type r5 r5 shamt=1 func=sll
Circuits
Gates
Transistors
16
Silicon
C int x = 10;
compiler x = 2 * x + 15;
High Level
MIPS Languages
addi r5, r0, 10
assembly muli r5, r5, 2
assembler addi r5, r5, 15
machine 00100000000001010000000000001010
code 00000000000001010010100001000000
00100000101001010000000000001111
CPU Instruction Set
Architecture (ISA)
Circuits
Gates
Transistors
17
Silicon
Machine Instruction
Characteristics
The operation of the processor is determined by the
instructions it executes, referred to as machine instructions or
computer instructions
16 bits
2) I/O device
The instruction must specify the I/O
module and device for the operation. 4) Immediate
If memory-mapped I/O is used, this The value of the operand is
is just another main or virtual contained in a field in the
memory address instruction being executed
Types of Operands
Numbers
All machine languages include numeric data types
Numbers stored in a computer are limited:
Limit to the magnitude of numbers representable on a machine
In the case of floating-point numbers, a limit to their precision
Packed decimal
Each decimal digit is represented by a 4-bit code with two digits stored per byte
To form numbers 4-bit codes are strung together, usually in multiples of 8 bits
Characters
A common form of data is text or character strings
Textual data in character form cannot be easily stored or transmitted by
data processing and communications systems because they are designed
for binary data
Most commonly used character code is the International Reference
Alphabet (IRA)
Referred to in the United States as the American Standard Code for
Information Interchange (ASCII)
Multiple Multiple
operands results
means Registers
PC 100 IR R0 R1
load R0, M[500]
I/O
10
PC 100 IR R0 R1
load R0, M[500]
I/O
instruction does
nothing during PC 100 IR R0
10
R1
load R0, M[500]
this sub-
operation I/O
memory Registers
This particular
instruction does PC 100 IR R0
10
R1
load R0, M[500]
nothing during
this sub- I/O
...
operation 100 load R0, M[500]
101 inc R1, R0
Memory
500 10
501
102 store M[501], R1 ...
Instruction Cycles
PC=100 Processor
Registers
10
PC 100 IR R0 R1
load R0, M[500]
I/O
PC=101
Registers
Fetch Decode Fetch Exec. Store
ops results
clk
10 11
PC 101 IR R0 R1
inc R1, R0
I/O
PC=101
Registers
Fetch Decode Fetch Exec. Store
ops results
clk
10 11
PC 102 IR R0 R1
store M[501], R1
PC=102
Fetch Decode Fetch Exec. Store I/O
ops results ...
100 load R0, M[500] Memory
clk 500 10
101 inc R1, R0 501 11
102 store M[501], R1 ...
Thank you for your listening