Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 18

Introduction to Binary systems

There are basically four types of


number systems
Topics
• Decimal Numbers
• Binary Numbers
• Octal Numbers
• Hexadecimal Numbers
i. Decimal Numbers
• Are numbers composed of digits from digit 0 to digit 9.
• They are also referred to as numbers to base 10 (there
are ten digits in number). E.g 462.15 or 462.1510.
• These are numbers that people use in measurements
and calculations
ii. Binary Numbers
• Use a combination of only two digits; 1 and 0 to
represent data, hence referred to as numbers to base 2.
• Computers use binary number system to process and
perform computations due their 1/0(on/off) electrical
circuit states they use. Eg is 110.112
Binary Number Addition and Subtraction
Binary and decimal
Decimal No. 0-3 and number Addition and
Binary Equivalence subtraction examples

Binary Decimal Binary


Number Decimal Numbers Numbers

00 Number 1+1+1=3 1+1+1=11


01 0 3-1=2 11-1=10
2-1=1 10-1=1
10 1 NB: Binary numbers are expresses as
11 2 expressed as 10, 0010, 00000010 etc
2 (2, 4, 8, 6, 32, 64, 128 etc) E.g 2 can be
n
Key Addition and Subtraction Results

Addition Subtraction

1+0=1 1-0=1
1+1=10 10-1=1
1+1+1=11 11-1=10
Addition/Subtraction
Subtraction
Examples
Addition
111
1111 -101
+ 100 10
10 11

11
1 11111
010 1
1 1 10 10
+111
10110 - 1 0 1
1 1 1
Decimal to Binary conversions
• Example. Convert 462.15 to binary
number
• The whole number part is divided
continuously by 2 to write digit 0 if
there is no remainder and write digit 1
if there is a remainder.
• The series of binary numbers are
recorded from last to first obtained
numbers.
462÷2=231 R 0
231÷2=115 R 1
115÷2=57 R 1
57 ÷2=28 R 1
28 ÷2=14 R 0
14 ÷2=7 R 0
7 ÷2=3 R 1
3 ÷2=1 R 1
1 ÷2=0 R 1
46210=111001110
The decimal part is successfully
multiplied by 2 to write digit 1 for
whole part result and digit 0 for
decimal result. Digits are listed from
the first to last
i.e 0 .15×2=0.3 R 0
0.3×2=0.6 R 0
0.6×2=1.2 R 1 etc
 0.1510=001 to three binary numbers
462.15 =111001110.001
Binary to Decimal Conversions
• In order to convert between binary and decimal numbers, we need to
understand the relationship between the digits of a given number, the
position of those digits, and the base of the number system.
• e.g convert 110.012 to base 10

Value 4 2 1 0.5 0.25


Position 22 21 20 2-1 2-2 ×
Binary
1 1 0 0 1
Product 4 2 0 0 0.25

Decimal number =sum product of value and the binary numbers


 110.012=4+2+0+0+0.25
=6.2510
iii#&iv. Hexadecimal and Octal Numbers
• Hexadecimal is a base 16
number system that uses Binary Octal Decimal Hexadecimal
digits 0-9 alongside letters 0000
0001
0
1
0
1
0
1
A-F of the alphabet. 0010 2 2 2
0011 3 3 3
• Octal number system is a 0100 4 4 4
0101 5 5 5
base 8 number system 0110 6 6 6
and uses digit 0 to 7 to 0111
1000
7
10
7
8
7
8
represent numbers 1001 11 9 9
1010 12 10 A
• They are used when 1011 13 11 B
1100 14 12 C
representing large binary 1101 15 13 D
numbers E.g 1110 16 14 E
1111 17 15 F
Blue=0000000000110011 Base-2 Base-8 Base-10 Base-16
110011002(0033CC16)
Examples of Number Conversions
Convert 1473.28 to decimal
Value 512 64 8 1 0.125
Base 83 82 81 80 8-1
value
Octal 1 4 7 3 2
Product 512 256 56 3 0.25

1473.28=512+256+56+3+0.25
=827.2510
Convert 33B.416 to base 10

Value 256 16 1 0.0625


Base value 162 161 160 16-1
Hexadecimal 3 3 B (11) 4
Product 768 48 11 0.25

33B.416=768+48+11+0.25
=827.2510
Comparing Number Systems
Consider the decimal number 827.25. The
table below gives the value of this number in
binary, octal, decimal and hexadecimal
System Number Base Length of digits
Binary 1100111011.01 2 12
Octal 1473.2 8 4
Decimal 827.25 10 5
Hexadecimal 33B.4 16 4

Note i. The smaller the base, the more the


digits
ii. Binary, octal and hexadecimal numbers all
have 2 as a common base factors. This allows
easy conversions between these numbers
Examples of Number Conversions
Example: Convert 1473.28 to base 2
Replace each digit with an equivalent 3-bit binary
number for octal numbers (8=23)

1473.2
Octal 1 4 7 3 2
Binary 001 100 111 011 010
001100111011.010

Or 4-bit binary numbers for hexadecimal numbers


(16=24)
Hexade 33B.4
cimal 3 3 B 4

  0011 0011 1011 0100


Binary 001100111011.0100
Other Binary coding systems
Include
• Binary coded decimal (BCD) codes each digit using four binary
numbers into binary number rather the whole number
• e.g 3710= 3 7 =00110111
0011 0111
• Letters and other characters use 6-bit coding instead of the 4-bit
coding in numbers because there are more many number of
characters to be coded.
• Extended binary-coded decimal interchange code (EBCDIC)
extends the 6-bit binary (26=64), which can only accommodate a
maximum of 64 characters, to 8-bit binary representation (2 8=256)
to accommodate the many more types of characters that exists.
• American standard code for information interchange (ASCII) is a
widely used coding system and common in data communication. It
also uses 8-bit binary representation for each character
Example of ASCII and EBCDIC character
representation

Character ASCII EBCDIC


A 01000001 11000001
B 01000010 11000010
1 00110001 11110001
2 00110010 11110010
Assignment
1. Perform the following binary number
operations
i. 10101111+11010101,
ii. 11010001-10011111
2. Perform the following number systems
conversions
iii. 191.75 base 10 to base 2,
iv. 1100101 base 2 to base 8,
v. 1101.1010 base 2 to base 10 ,
vi. 44C.7 base 16 to base 8

You might also like