Cao Co3
Cao Co3
1
2
Syllabus
3
References:
1. Carl Hamacher, Zvonko Vranesic and Safwat Zaky, Computer Organization and
Embedded Systems, (6e), McGraw Hill Publication, 2012.
2. William Stallings, Computer Organization and Architecture – Designing for
Performance, (9e), PHI, 2015.
3. Mohammed Rafiquzzaman and Rajan Chandra, Modern Computer Architecture,
Galgotia Publications Pvt. Ltd., 2010
4
Hardware implementation of
Arithmetic operation with signed
numbers
5
Binary Number Representation
6
Signed and Unsigned Binary
7
Finding 1’s complement
8
Inverters used to obtain 1’s complement of a binary
numbers
9
Finding 2’s complement
10
Finding 2’s complement
11
Representation of the signed integers in Binary Three forms
Signed
1’s 2’s
Magnitude
Complement Complement
form
12
Representation of the signed integers in Binary Three forms
13
Representation of the signed integers in Binary Three forms
14
Representation of the signed integers in Binary Three forms
15
Representation of the signed integers in Decimal forms
16
Representation of the signed integers in Decimal forms
17
Range on 2’s complement representation
18
• Arithmetic operation with
numbers Addition
Subtraction
Multiplication
Division
19
Addition with Unsigned number
20
Subtraction with Unsigned number
21
Rules for Addition and Subtraction using Signed –
Magnitude Data
22
Hardware for sign Magnitude addition and subtraction
23
Signed 2’s compliment addition and subtraction
24
Hardware for signed 2’s compliment addition and
subtraction
25
Overflow?
26
Examples of Overflow
27
Multiplication with Unsigned number
28
Hardware Implementation of multiplication
29
Example
Multiplicand = 10111
Multiplier = 10011
30
Booth’s Algorithm Multiplication with signed 2's complement
data
• Booth algorithm gives a procedure for multiplying binary integers in
signed 2’s complement representation in efficient way.
31
Hardware
Implementation of
Booths Algorithm –
32
33
Booth’s
Algorithm
Flowchart –
AC and the appended bit Qn+1 are initially
cleared to 0
34
Example – A numerical example of booth’s algorithm , multiplication of -5 and -7.
BR = -5 = 1011,
BR'+1 = 0101 <-- 2's Complement (add 1 to the Binary value obtained after 1's complement)
Qn Qn+1 = 10
OPERATION AC QR Qn+1 SC
0000 1001 0 4
AC + BR’ + 1 0101 1001 0
ASHR 0010 1100 1 3
AC + BR 1101 1100 1
ASHR 1110 1110 0 2
ASHR 1111 0111 0 1
AC + BR’ + 1 0100 0111 0
ASHR 0010 0011 1 0
Product = AC QR
Product = 0010 0011 = 35
36
Problem
37
38
Problem
39
40
Advantages
Faster than
traditional
multiplication
Efficient
Widely
for
used in
signed
hardware
numbers
Lower hardware
requirement
41
Disadvantages
Complex to Limited
understand applicability
Higher
Higher
power
latency:.
consumption
42
Division
43
Hardware Implementation of division
44
Flowchart of Division
45
Example
Divisor B=10001,
Dividend = 0111000
46