Course :Computer Class :
System Sem-1
Architecture
Lesson :Number System
By :Goutam Sanyal
Why
• Clear view as to how a computer system works.
• Operating system design
• Design of logic circuit ,Microprocessor and microcontroller
Objective
• Data representation
• digital logic circuits design
• Basic CPU and Memory design
• Assembly language program
Syllabus
1. Introduction
Logic gates, boolean algebra, combinational circuits, circuit
simplification, flip-flops and sequential circuits, decoders,
multiplexers, registers, counters and memory units.
2. Data Representation and Basic Computer Arithmetic
Number systems, complements, fixed and floating point
representation, character representation, addition, subtraction,
magnitude comparison, multiplication and division algorithms
for integers
Syllabus (Contd..)
3. Basic Computer Organization and Design
Computer registers, bus system, instruction set, timing and
control, instruction cycle, memory reference, input -output and
interrupt, Interconnection Structures, Bus Interconnection
design of basic computer.
4. Central Processing Unit
Register organization, arithmetic and logical micro-operations,
stack organization, micro programmed control. Instruction
formats, addressing modes, instruction codes, machine
language, assembly language, input output programming, RISC,
CISC architectures, pipelining and parallel architecture.
Syllabus (Contd..)
5. Memory Organization
Cache memory, Associative memory, mapping.
6. Input-Output Organization
Input / Output: External Devices, I/O Modules, Programmed I/O,
Interrupt-Driven I/O, Direct Memory Access, I/O Channels.
Books
• Text Book
Computer fundamental By Floyd and Jain
M. Mano, Computer System Architecture, Pearson Education 1992
• Reference Books:
A. J. Dos Reis, Assembly Language and Computer Architecture using
C++ and JAVA,Course Technology, 2004
W. Stallings, Computer Organization and Architecture Designing for
Performance, 8 Edition, Prentice Hall of India,2009
M.M. Mano , Digital Design, Pearson Education Asia,2013
B Ram , Computer Organization, Eighth edition,
Number Systems
Types Of Numbers
• Natural Numbers
– The number 0 and any number obtained by
repeatedly adding a count of 1 to 0
• Negative Numbers
– A value less than 0
• Integer
– A natural number, the negative of a natural number,
and 0.
– So an integer number system is a system for
‘counting’ things in a simple systematic way
Exponent Review
• An exponent (power) tells you how many times to
multiply the base by itself:
– 21 = 2
– 22 = 2 x 2 =4
– 23 = 2 x 2 x 2 = 8
• 20 = 1 (ANY number raised to power 0 is 1)
• 1 / x2 = x -2
Decimal Numbering System
• How is a positive integer represented in decimal?
• Let’s analyze the decimal number 375:
375 = (3 x 100) + (7 x 10) + (5 x 1)
= (3 x 102) + (7 x 101) + (5 x 100)
Position weights 102 101 100
Number digits 3 7 5
5 x100 = 5 +
7 x101 = 70 +
3 x 102 = 300
375
Decimal System Principles
• A decimal number is a sequence of digits
• Decimal digits must be in the set:
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9} (Base 10)
• Each digit contributes to the value the number
represents
• The value contributed by a digit equals the product of
the digit times the weight of the position of the digit in
the number
Decimal System Principles
• Position weights are powers of 10
• The weight of the rightmost (least significant digit)
is 100 (i.e.1)
• The weight of any position is 10x, where x is the
number of positions to the right of the least
significant digit
Position weights 104 103 102 101 100
digits 3 7 5
Bits
• In a computer, information is stored using digital
signals that translate to binary numbers
• A single binary digit (0 or 1) is called a bit
– A single bit can represent two possible states,
on (1) or off (0)
• Combinations of bits are used to store values
Data Representation
• Data representation means encoding data into bits
– Typically, multiple bits are used to represent the
‘code’ of each value being represented
• Values being represented may be characters, numbers,
images, audio signals, and video signals.
• Although a different scheme is used to encode each type
of data, in the end the code is always a string of zeros
and ones
Decimal to Binary
• So in a computer, the only possible digits we can use to
encode data are {0,1}
– The numbering system that uses this set of digits is
the base 2 system (also called the Binary Numbering
System)
• We can apply all the principles of the base 10 system to
the base 2 system
Position weights 24 23 22 21 20
digits 1 0 1 1
Binary Numbering System
• How is a positive integer represented in binary?
• Let’s analyze the binary number 110:
110 = (1 x 22) + (1 x 21) + (0 x 20)
= (1 x 4) + (1 x 2) + (0 x 1)
Position weights 22 21 20
Number digits 1 1 0
0 x20 = 0 +
1 x21 = 2 +
1 x 22 = 4
6
◼ So a count of SIX is represented in binary as 110
Binary to Decimal Conversion
◼ To convert a base 2 (binary) number to base
10 (decimal):
◼ Add all the values (positional weights)
where a one digit occurs
◼ Positions where a zero digit occurs do
NOT add to the value, and can be
ignored
Binary to Decimal Conversion
Example: Convert binary 100101 to decimal
(written 1 0 0 1 0 12 ) =
1*20 + 1+
0*21 +
1*22 + 4+
0*23 +
0*24 +
1*25 32
3710
Binary to Decimal Conversion
◼ Example #2: 101112
positional powers of 2: 2 4 23 2 2 21 20
decimal positional value: 16 8 4 2 1
binary number: 1 0 1 1 1
16 + 4 + 2 + 1 = 2310
Decimal to Binary Conversion
The Division Method:
1) Start with your number (call it N) in base 10
2) Divide N by 2 and record the remainder
3) If (quotient = 0) then stop
else make the quotient your new N, and go back to step 2
The remainders comprise your answer, starting with the last
remainder as your first (leftmost) digit.
In other words, divide the decimal number by 2 until you reach
zero, and then collect the remainders in reverse.
Decimal to Binary Conversion
Using the Division Method:
Divide decimal number by 2 until you reach zero, and then
collect the remainders in reverse.
Example 1: 2210 = 101102
2 ) 22 Rem:
2 ) 11 0
2) 5 1
2) 2 1
2) 1 0
0 1
Decimal to Binary Conversion
Using the Division Method
Example 2: 5610 = 1110002
2 ) 56 Rem:
2 ) 28 0
2 ) 14 0
2) 7 0
2) 3 1
2) 1 1
0 1
Decimal to Binary Conversion
The Subtraction Method:
▪ Subtract out largest power of 2 possible
(without going below zero), repeating until you
reach 0.
▪ Place a 1 in each position where you
COULD subtract the value
▪ Place a 0 in each position that you could
NOT subtract out the value without going
below zero.
Decimal to Binary Conversion
Example 1: 2110
21 26 25 24 23 22 21 20
- 16 64 32 16 8 4 2 1
5 1 0 1 0 1
- 4
1
- 1 Answer: 2110 = 101012
0
Decimal to Binary Conversion
Example 2: 5610
56 26 | 25 24 23 22 21 20
- 32 64| 32 16 8 4 2 1
24 |1 1 1 0 0 0
- 16
8
- 8 Answer: 5610 = 1110002
0
Thank You