Topic 1 - Numbering System
Topic 1 - Numbering System
Topic 1 - Numbering System
AAB 22202
DIGITAL TECHNIQUES
(MECHANICAL)
TOPIC 1
NUMBERING 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)
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 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.
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.
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
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
HEXADECIMAL SYSTEM
• BINARY to HEX Conversion
- Divide BINARY number into groups of 4 bits STARTING at LSB.
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
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
BCD
• Exercise:
a) Convert from decimal to BCD
i. 94 1001 0100
ii. 529 0101 0010 1001
iii. 2947 0010 1001 0100 0111
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.
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 :
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
+2 = 00010
Invert = 11101
Add 1 = 11110
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