CS0003 Module 1 - Binary Numbers
CS0003 Module 1 - Binary Numbers
to Programming
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.
3
Base 2: The Binary Number System
1 1 0 0
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
7
Binary Addition
1101
+0 1 1 1
Example
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 1101
following binary x0111
numbers 1101
11010
Partial Products
110100
0000000
1011011
Binary Division