Data Representation
Syllabus: Number system (Binary, Octal, Decimal, and Hexadecimal); Conversion from One Number System to Another; Binary Arithmetic (Addition and Subtraction); Logic gates
Number System
A number system defines a set of values to represent quantity. It is a set of rules to represent a number. There are 2 types of number systems,
- Non-Positional Number System
- Positional Number System
Binary, Octal, Decimal, and Hexadecimal number systems are positional number systems. So in this chapter, we’ll learn about the different positional number systems.
In each number system, the base is the total number of digits or symbols in that number system. The maximum value of single-digit in each number system is one less than that of the base. ( That also means that the base of any number system is one more than that of the maximum value of single-digit. )
Binary Number System
The binary number system is a positional number system.
There are only two symbols or digits (i.e., 0 and 1) in Binary Number System; hence its base is 2.
The maximum value of single-digit is 1. Each position of a digit represents a specific power of the base (2).
This number system is used in computers.
Eg. (10111001)2
Octal Number System
In the octal number system, there are 8 symbols or digits (i.e., 0, 1, 2, 3, 4, 5, 6, and 7); hence its base is 8.
The maximum value of single-digit is 7. Each position of a digit represents a specific power of the base (8).
Eg. (62340)8
Decimal Number System
In the decimal number system, there are 10 symbols or digits (i.e., 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9); hence its base is 10.
The maximum value of single-digit is 9. Each position of a digit represents a specific power of the base (10).
We use this number system in our day-to-day life.
Eg. (28940583)10
Hexadecimal Number System
Hexadecimal number system has 16 symbols or digits (i.e., 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F) hence its base is 16.
The symbols A, B, C, D, E, and F represent 10, 11, 12, 13, 14, and 15, respectively.
The maximum value of single-digit is 15. Each position of a digit represents a specific power of the base (16).
Eg. (A456FC)16
Conversion from One Number System to Another
Converting a number of another base to decimal number:
Step-1: Determine the column (positional) value of each digit
Step-2: Multiply the obtained column values by the digits in the corresponding columns
Converting decimal number to a number of another base:
Step-1: Divide the decimal number to be converted by the value of the new base
Step-2: Record the remainder from step-1 as the rightmost digit (least significant digit) of the new base system
Step-3: Divide the quotient of the previous by the new base
Step-4: Record the remainder from step-3 as the next digit (to the left) of the new base number
Step-5: Repeat step-3 and step-4, recording the remainders from right to left, until the quotient becomes zero in step-3.
Note: The last remainder obtained will be the Most Significant Digit (MSD) of the new base number.
Converting a number of some base to a number of another base:
Step-1: Convert the original number to the Decimal number
Step-2: Convert the Decimal number obtained to the new base number
Shortcut Methods
Step-1: Divide the binary digits into the group of three (starting from the right),
Step-2: Convert each group of three binary digits to one octal digit.
Example,
Step no.
|
Binary number
|
Octal number
|
1
|
11001112
|
12 1002 1112
|
2
|
11001112
|
184878
|
3
|
11001112
|
1478
|
Therefore, (1100111)2 = (147)8
Conversion from octal to binary:
Step-1: Convert each octal number to binary equivalent (make the digit count 3 like 18 = 0012 )
Step-2: Combine converted binary numbers according to the position of the octal number
Step no.
|
Octal number
|
Binary number
|
1
|
1478
|
12 42 72
|
2
|
1478
|
001210021112
|
3
|
1478
|
11001112
|
Therefore, (147)8 = (1100111)2
Conversion from binary to hexadecimal:
Step-1: Divide the binary digits into a group of four (starting from the right),
Step-2: Convert each group of four binary digits to one hexadecimal digit.
Step no.
|
Binary number
|
Hexadecimal number
|
1
|
11001112
|
1102 01112
|
2
|
11001112
|
616716
|
3
|
11001112
|
6716
|
Therefore, (1100111)2 = (67)16
Conversion from hexadecimal to binary:
Step-1: Convert each Hexadecimal number to Binary equivalent (make the digit count 3 like 616 = 01102 )
Step-2: Combine converted Binary numbers according to the position of Hexadecimal number
Step no.
|
Hexadecimal number
|
Hexadecimal number
|
1
|
6716
|
6716
|
2
|
6716
|
616716
|
3
|
6716
|
01102 01112
|
Therefore, (67)16 = (1100111)2
Binary Arithmetic
Binary Number System consists of 2 digits. They are 0 and 1. As like regular Decimal Numbers, we can perform addition, subtraction, multiplication as well as division. But in this chapter, we’ll only perform addition and subtraction.
Addition
The addition is combining two digits to produce another higher value digit.
The rule for Binary Addition is:
0
|
+
|
0
|
0
|
0
|
+
|
1
|
1
|
1
|
+
|
0
|
1
|
1
|
+
|
1
|
0 ( plus a carry of 1 to next higher column )
|
You can learn Addition in YouTube by clicking here.
Subtraction
Subtraction is the process of taking away some value from a digit resulting in the production of lower value digit.
The rule for Binary Subtraction is:
0
|
-
|
0
|
0
|
0
|
-
|
1
|
1 ( with borrow from the next column )
|
1
|
-
|
0
|
1
|
1
|
-
|
1
|
0
|
You can learn Subtraction in YouTube by clicking here.
Decimal Number System
|
Binary Number System
|
0
|
0
|
1
|
1
|
2
|
10
|
3
|
11
|
4
|
100
|
5
|
101
|
6
|
110
|
7
|
111
|
8
|
1000
|
9
|
1001
|
Logic Gates
Logic Gates are the electronic circuits that operate on one or more input signals. They are building blocks of all the circuits in a computer. Some of the basic and most useful logic gates are AND, OR, NOT, NAND, and NOR gates.
AND gate
The physical realization of logical multiplication (AND) operation.
Generates an output signal 1 only if all input signals are also 1.
OR gate
The physical realization of logical addition (OR) operation.
Generates an output signal of 1 if at least one of the input signal is also 1.
NOT gate
The physical realization of complementation operation.
Generates an output signal, which is the reverse of the input signal.
NAND gate
Complemented AND gate.
Generates an output signal of 1 if any one of the inputs is a 0 and generates 0 when all the inputs are 1.
NOR gate
Complemented OR gate.
Generates an output signal of 1 only when all inputs are 0 and generates 0 if any one of the inputs is a 1.
No comments:
Post a Comment