Topic 1 - Numbering System

Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

Malaysian Institute of Aviation Technology

AAB 22202
DIGITAL TECHNIQUES
(MECHANICAL)

TOPIC 1
NUMBERING SYSTEM
Malaysian Institute of Aviation Technology

TOPIC 1 : NUMBERING SYSTEM


Objectives :
• After studying the material in this chapter, you
should be able to:
i. Identifies binary, octal and hexadecimal system
ii. Convert and perform calculation on decimal and binary,
octal and hexadecimal systems and vice versa.
iii. Identify BCD system.
Malaysian Institute of Aviation Technology

DECIMAL SYSTEM
• Comprise of 10 digits from 0 to 9
• Base 10 system.
• Example : 25410
Malaysian Institute of Aviation Technology

DECIMAL SYSTEM
• POSITIONAL VALUE NUMBERING SYSTEM
Example : 25410 consists of 2 HUNDREDS, 5 TENS and 4 ONE
units.
Written as : (2 X100) + (5 X 10) + (4 X 1)
= (2 X 102) + (5 X 101) + (4 X 100)

• Digit 2 carries the MOST weight and is known as MOST


SIGNIFICANT DIGIT (MSD)
• Digit 4 carries the LEAST weight and is known as LEAST
SIGNIFICANT DIGIT (LSD)
Malaysian Institute of Aviation Technology

DECIMAL SYSTEM
• DISADVANTAGE for usage in digital computer
example transistor due to :
• Having 10 Discrete Value Level which is extremely
difficult to operate due to:
– Any VARIATION of POWER SUPPLY would cause
error
– Component TOLERANCE MUST be ZERO
– Component VALUE will change with AGE
Malaysian Institute of Aviation Technology

BINARY SYSTEM
• Comprise of 2 digits (0 & 1) known as BITS
• Base 2 system. Example : 10112
• POSITIONAL value system
10112 = (1 x 23) + (0 x 22) + (1x21) + (1x20)

• BINARY to DECIMAL Conversion


10112 = (1 x 23) + (0 x 22) + (1x21) + (1x20)
=8+0+2+1
= 11
sum of each bits multiplied by its particular positional value
Malaysian Institute of Aviation Technology

BINARY SYSTEM
• DECIMAL to BINARY Conversion
i)SUCCESSIVE POWER OF 2.
Example: 27 = 16 + 8 + 2 + 1
= 24 + 23 + 21 + 20
= (1x24) + (1x23) + (0x22) + (1x21) + (1x20)
=110112
ii) SUCCESSIVE divide by 2 and record any remainder of
division.

• Suitable for SMALL number


Malaysian Institute of Aviation Technology

BINARY SYSTEM
• Any number converted into BINARY form, the
binary numbers is known as a WORD.
• Each word is formed of a numbers of BITS
(BINARY DIGITS) and this represents the
WORD LENGTH
• Example : 34710 = 1010110112.
• So 1010110112 is a WORD. Word length is 9
because there is 9 bits
Malaysian Institute of Aviation Technology

Decimal Binary
Number Number

0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
10 1010
11 1011
12 1100
13 1101
14 1110
15 1111
Malaysian Institute of Aviation Technology

OCTAL SYSTEM
• Base 8 systems
• Composed of 8 digits from 0 to 7
• OCTAL to DECIMAL conversion
 Successive power of 8
Example : 2758 = (2x82) + (7x81) + (5x80)
= 128 + 56 + 5 = 18910
• DECIMAL to OCTAL conversion
 Divide by 8 and Record any REMAINDER of division
Malaysian Institute of Aviation Technology

OCTAL SYSTEM
• OCTAL to BINARY conversion
• Convert each OCTAL number into 3 bits BINARY
equivalent.

Example : 6358 TO BINARY.


6 3 5
110 011 101

Thus, 6358= 1100111012


Malaysian Institute of Aviation Technology

OCTAL SYSTEM
• BINARY to OCTAL conversion
- Divide BINARY number into groups of 3 BITS starting from
LSB.
Example :1001110112 TO OCTAL.
100 111 011
4 7 3
Thus, 1001110112 = 4738

• If the FINAL group of MSB does NOT have 3 BITS, ADD enough
ZERO to make up 3 BITS.
Malaysian Institute of Aviation Technology

Decimal Octal Binary


0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 10 1000
9 11 1001
10 12 1010
11 13 1011
12 14 1100
13 15 1101
14 16 1110
15 17 1111
Malaysian Institute of Aviation Technology

HEXADECIMAL SYSTEM
• BASE 16.
• Composed of 16 digit Symbols
0123456789ABCDEF
• Example: 85D1B16
• HEX to DECIMAL conversion
- SUCCESSIVE POWER OF 16
Example : B2F16 = (11 x 162) + (2 x 161) + (15 x 160)
= 2816 + 32 + 15
= 286310
Malaysian Institute of Aviation Technology

HEXADECIMAL SYSTEM
• DECIMAL to HEX Conversion
Divide with 16 and take the REMAINDER of division
• HEX to BINARY Conversion
Convert each HEX digit into 4 bits BINARY equivalent.
i.e. B2F16 TO BINARY
B 2 F
1011 0010 1111

THUS, B2F16= 1011001011112


Malaysian Institute of Aviation Technology

HEXADECIMAL SYSTEM
• BINARY to HEX Conversion
- Divide BINARY number into groups of 4 bits STARTING at LSB.

i.e. 1101101010012 TO HEX


1101 1010 1001
13 10 9
D A 9

Thus, 1101101010012 = DA916


Malaysian Institute of Aviation Technology

HEXADECIMAL SYSTEM
• HEX to OCTAL Conversion and vice versa
i) Convert HEX to BINARY
ii)Convert BINARY to OCTAL
 To Convert OCTAL to HEX, just REVERSE the process
Example : 3D16 convert to OCTAL
i) Convert HEX to BINARY, 3 D
0011 1101 3D16=1111012

ii) Convert BINARY to OCTAL, 111 101


7 5 1111012=758
Thus, 3D16=758
Malaysian Institute of Aviation Technology

Decimal Hexadecimal Binary


0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
10 A 1010
11 B 1011
12 C 1100
13 D 1101
14 E 1110
15 F 1111
Malaysian Institute of Aviation Technology

BCD
• Binary Coded Decimal
• Number represented in 4 bits binary code
• Leaving a space between each group of 4
digits
• Example :
a) 1110 to BCD is 0001 0001
b) 1000 0101 in BCD to Decimal is 8510
Malaysian Institute of Aviation Technology

Decimal Binary BCD


0 0000 0000
1 0001 0001
2 0010 0010
3 0011 0011
4 0100 0100
5 0101 0101
6 0110 0110
7 0111 0111
8 1000 1000
9 1001 1001
10 1010 0001 0000
11 1011 0001 0001
12 1100 0001 0010
13 1101 0001 0011
14 1110 0001 0100
15 1111 0001 0101
Malaysian Institute of Aviation Technology

BCD
• Exercise:
a) Convert from decimal to BCD
i. 94 1001 0100
ii. 529 0101 0010 1001
iii. 2947 0010 1001 0100 0111

b) Convert from BCD to decimal


i. 011100001001 70910
ii. 001101100100 36410
Malaysian Institute of Aviation Technology

1’s COMPLEMENT
The 1’s complement of a binary number is just the inverse of the
digits. To form the 1’s complement, change all 0’s to 1’s and all 1’s
to 0’s.

For example, the 1’s complement of 11001010 is 00110101

In digital circuits, the 1’s complement is formed by using inverters:

1 1 0 0 1 0 1 0

0 0 1 1 0 1 0 1
Malaysian Institute of Aviation Technology

2’s COMPLEMENT
The 2’s complement of a binary number is found by adding 1 to the
LSB of the 1’s complement.
Recall that the 1’s complement of 11001010 is
00110101 (1’s complement)
To form the 2’s complement, add 1: +1
00110110 (2’s complement)
1 1 0 0 1 0 1 0
1
0 0 1 1 0 1 0 1
Input bits
Carry
Adder
in (add 1)
Output bits (sum)

0 0 1 1 0 1 1 0
Malaysian Institute of Aviation Technology
Malaysian Institute of Aviation Technology

ADDITION
• The rules for binary addition are :

0+0=0 Sum = 0, carry = 0


0+1=1 Sum = 1, carry = 0
1+0=1 Sum = 1, carry = 0
1 + 1 = 10 Sum = 0, carry = 1
Malaysian Institute of Aviation Technology

ADDITION
EXAMPLE
• Add the binary numbers 00111 and 10101 and
show the equivalent decimal addition.
0111
00111 7
+ 10101 21
11100 = 28
Malaysian Institute of Aviation Technology

SUBTRACTION
• The rules for binary subtraction are :

0-0=0
1-1=0
1-0=1
10 - 1 = 1 with a borrow of 1
Malaysian Institute of Aviation Technology

SUBTRACTION
• EXAMPLE
• Subtract the binary number 00111 from
10101 and show the equivalent decimal
subtraction.
111
10101
/// 21
00111 7
01110 = 14
Malaysian Institute of Aviation Technology

MULTIPLICATION
• The rules for binary multiplication are :
0.0=0
0.1=0
1.0=0
1.1=1
• Example : 11002 x 112 =100100
• In computer, it is achieved by repeated addition.
• Ex: In decimal 2 x 4 is computed as 2+2+2+2 = 8
Malaysian Institute of Aviation Technology

DIVISION
• Rules
1÷1=1
0÷1=0

• Example : 1111002 ÷ 1102 (60 ÷ 6)


= 10102 (10)
• Computer CAN NOT divide. It divide by repeated
subtraction
Malaysian Institute of Aviation Technology

POSITIVE & NEGATIVE


• Additional bit ONLY for storing numbers but DOES NOT allow
direct subtraction of one number from another
• Use TWO’s COMPLEMENT
• Process of inverting each bit in a word and adding 1
• Example : Find negative binary number of + 5
i) +5 as a 4 bit word 00101
ii) Invert (change ‘0’ to ‘1’ & ‘1’ to ‘0’) 11010
iii)Add 1 + 1
iv)Answer 11011
Malaysian Institute of Aviation Technology

POSITIVE & NEGATIVE


• When numbers are represented as NEGATIVE,
subtraction is achieved by addition
• Adding a negative number is the SAME as
subtracting a positive number
• Example :
5 – 7 = 5 + (-7)
Malaysian Institute of Aviation Technology

POSITIVE & NEGATIVE


5 – 7 = 5 + (-7) +7 = 00111
= 00101 + 11001 Invert = 11000
=11110 Add 1 = 11001
= -2

+2 = 00010
Invert = 11101
Add 1 = 11110
Malaysian Institute of Aviation Technology

POSITIVE & NEGATIVE


• Conclusion
– Both addition and subtraction CAN be done
– by the SAME circuits in a computer which
considerably REDUCES the hardware involved
Malaysian Institute of Aviation Technology

TUTORIAL
1) Convert 17710 to octal system.
2) Convert 9F216 to binary system.
3) Convert 101111112 to decimal system.
4) Add hex numbers 58 + 4B
5) Determine :
a) + 13 – 9
b) 1001 x 1011
c) 01001 – 11010
d) Two’s complement of 01100

You might also like