Module 1: Computer Fundamentals 1.1 Introduction To Number System and Codes
Module 1: Computer Fundamentals 1.1 Introduction To Number System and Codes
• This means that the value of digits will depend on its position.
Binary number system:
The easiest way to vary instructions through electric
signals is two-state system on and off.
On is represented as 1 and off as 0, though 0 is not
actually no signal but signal at a lower voltage.
The number system having just these two digits 0 and
1 is called binary number system.
Each binary digit is also called a bit. Binary number
system is also positional value system, where each
digit has a value expressed in powers of 2.
• In any binary number, the rightmost digit is
called Least significant bit (LSB) and leftmost digit
is called Most significant bit (MSB).
Octal Number System:
1 6 2 . 3 7 5 Digits
100 10 1 1/10 1/100 1/1000 weight
These weights are all powers of the base, which is 10. We can
rewrite this:
1 6 2 . 3 7 5 Digits
102 101 100 10-1 10-2 10-3 weight
d2*B2+d1*B1+d0*B0+d-1*B-1+d-2*B-2
(512.74)10
NUMBER CONVERSIONS
Binary to Decimal
Octal to Decimal
Hexadecimal to Decimal
Binary to Decimal Number System
Base = 2
2 digits { 0, 1 }, called binary digits or “bits”
Weights 4 2 1 1/2 1/4
Weight = (Base) Position 1 0 1 0 1
Magnitude 2 1 0 -1 -2
Sum of “Digit x Weight”
1 *22+0 *21+1 *20+0 *2-1+1 *2-2
Formal Notation
=(5.25)10
Groups of bits
(101.01)2
4 bits = Nibble 1 0 1 1
8 bits = Byte 11000101
EXAMPLE:
Convert the binary number in to decimal number
1) 010112
2) 0101111002
Octal to Decimal Number System
Base = 8
8 digits { 0, 1, 2, 3, 4, 5, 6, 7 }
Weights
64 8 1 1/8 1/64
Weight = (Base) Position
5 1 2 7 4
Magnitude
Sum of “Digit x Weight” 2 1 0 -1 -2
=(330.9375)10
(512.74)8
EXAMPLE
Convert the Octal number in to Decimal number
1) 178
2) 532.28
Hexadecimal to Decimal Number System
Base = 16
16 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F }
Weights
256 16 1 1/16 1/256
Weight = (Base) Position
1 E 5 7 A
Magnitude
Sum of “Digit x Weight” 2 1 0 -1 -2
=(485.4765625)10
(1E5.7A)16
EXAMPLE
Convert the hexadecimal number to Decimal
1) 6DE 16
2) 1E.5316
Number Base Conversions
Evaluate
Magnitude
Octal
(Base 8)
Evaluate
Magnitude
Decimal Binary
(Base 10) (Base 2)
Hexadecimal
(Base 16)
Evaluate
Magnitude
Link for MCQ:
https://forms.office.com/Pages/ResponsePage.aspx?
id=ACxf6DAnpUy42GCbFb1HRtznbjjqgR1Lvg0-
Z8ZyXBlUQ1VTR1pBRzRUSkczV09ENkpUTkZGSFlEVC4u
Binary
Binary representation:
The Power of 2
n 2n n 2n
0 20=1 8 28=256
1 21=2 9 29=512
2 22=4 10 210=1024 Kilo
3 23=8 11 211=2048
4 24=16 12 212=4096
5 25=32 20 220=1M Mega
1 0 0 1 1 1 0 1
1*27 + 0*26 + 0*25 + 1*24 + 1*23 + 1*22 + 0*21 + 1*20
1* 128 + 0*64 + 0*32 + 1*16 + 1*8 + 1*4 + 0* 2 + 1* 1
128 + 16 + 8 + 4 +1
(157) 10
Binary to Decimal :
Example 2 :Convert the binary 1101.01 to decimal.
1 1 0 1 . 0 1 Binary digits, or bits
23 22 21 20 2-1 2-2 Weights (in base 2)
To convert a fraction, keep multiplying the fractional part by 2 until it becomes
(746) 10 =(1011101010)
2
Convert from decimal to binary:
Endless Pattern Example
(21.1) 10 =(10101.00011)2
CONVERT FROM DECIMAL TO HEXADECIMAL:
Example :
Convert from decimal to hex
764= ?
(764) 10 = (2EA) 16
CONVERT FROM DECIMAL TO
HEXADECIMAL:
Decimal to Octal Conversion:
Example: (175)10
Quotient Remainder Coefficient
175 / 8 = 21 7 a0 = 7
21 / 8 = 2 5 a1 = 5
2 /8= 0 2 a2 = 2
Answer: (175)10 = (a2 a1 a0)8 = (257)8
Example: (0.3125)10
Integer Fraction Coefficient
0.3125 * 8 = 2 . 5 a-1 = 2
0.5 *8= 4 . 0 a-2 = 4
Answer: (0.3125)10 = (0.a-1 a-2 a-3)8 = (0.24)8
convert hexadecimal to binary:
Replace each hex digit with its equivalent 4-bit binary sequence.
261.3516 = 2 6 1 . 3 516
= 0010 0110 0001 . 0011 01012
( 1 0 1 1 0 . 0 1 )2 4 100
5 101
6 110
( 2 6 . 2 )8 7 111
( 0 1 0 1 1 0 . 0 1 0 )2
(1 6 . 4 )16
Evaluate
Magnitude
Decimal Binary
(Base 10) (Base 2)
Hexadecimal
(Base 16)
Evaluate
Magnitude
https://forms.office.com/Pages/ResponsePage.aspx?
id=ACxf6DAnpUy42GCbFb1HRtznbjjqgR1Lvg0-
Z8ZyXBlUQjNETUdFSkFUVVRNQVlSVzZZR0xaNTU2WS4u