Sunteți pe pagina 1din 17

Computer Systems

Organization and
Architecture (ITECOMPSYS)

Module 2
Binary Number System
Base 2: The Binary Number System
• The word “binary” comes from the Latin word
bis, meaning double.
• Thus, the number base of the binary number
system is base 2.
• Since it is in base 2, two symbols are used in the
binary number system.
{0,1}
• This means that only the digits in the above set
can be used for each position in every place
value in a given binary number.
2
Base 2: The Binary Number System
1 1 0 0

• Note that the highlighted place value can be filled by


the digits in the set {0,1}.
• Thus, it can be increased by 1 until it reaches -
1 1 0 1

• At this point, the symbols that can be used to fill the


highlighted position has been exhausted. Increasing
it further causes a shift in place value, and resets the
initial place value to zero. Thus -
1 1 1 0
Base 2: The Binary Number System
• To avoid confusion, one should write a binary
number with base 2 as its subscript whenever
necessary.

• Thus, the binary number 10110 should be written as

101102
• It should be read as “one-zero-one-one-zero base
two” and NOT “ten-thousand one-hundred ten” since
each phrase denotes an entirely different number.
Base 2: The Binary Number System
• Case Study: 101102
• We know that the decimal number 3474 can be
expressed as powers of 10 –
(3x103) + (4x102) + (7x101) + (4x100) = 347410
• In the same manner, the binary number 101102 can
be expressed as powers of 2 –
(1x24) + (0x23) + (1x22) + (1x21) + (0x20) = 2210
Note that the rightmost exponent starts from zero
and increases by 1 as the place value increases.
Hence, the binary number system is said to be in
base 2.
Binary Arithmetic
• Addition
• Subtraction
• Multiplication
• Division

6
Binary Addition

•Single Bit Addition Table


0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 10 Note “carry”
Example

Add the following binary numbers

1101
+0 1 1 1
Example

Add the following binary numbers

1 1
1101
+0 1 1 1
10100
Binary Subtraction

•Single Bit Subtraction Table


0 - 0 = 0
1 - 0 = 1
1 - 1 = 0
0 - 1 = 1 with a “borrow”
Example

Subtract the binary number below.


1
1 1
00
1 101
-0111
0110
Binary Multiplication
•Single Bit Multiplication Table

0 1
0 0 0
1 0 1
Binary Multiplication

•Single Bit Multiplication Table


0 x 0 = 0
0 x 1 = 0
1 x 0 = 0
1 x 1 = 1
Example

Multiply the following binary numbers


1101
x0111
1101
11010
Partial Products
110100
0000000
1011011
Binary Division

•Single Bit Division Table


0 / 0 = N/A
0 / 1 = 0
1 / 0 = N/A
1 / 1 = 1
Example
Divide the binary number below.
0 0 01 Quotient

Divisor 111 1101 Dividend

11
00
110
000
1101
111
Remainder
110

S-ar putea să vă placă și