Number System
Number System
DIGITAL ELECTRONICS
Number System:
A number system is defined as a system of writing to express numbers. A number system is a mathematical
system with base n, where n represents total numbers present in that system. Eg: In decimal number
system, the number of digits is 10
Radix Point:
Radix point is a base point used to separate the integer part and the fractional part of a number.
Base or radix:
The number of symbols used in a number system is called base or radix of the number system.
The right most bit of a binary number which has the least place value is called least significant bit.
Bit:
A binary digit is called a bit. Example:
0 or 1
Nibble:
A group of four bits is called a Nibble. Example:
0110, 1110 etc.
Byte:
A group of eight bits is called a byte. Example:
01101101, 11010011 etc.
1
S
Binary Arithmetic
Binary arithmetic includes the basic arithmetic operations of addition, subtraction, multiplication
and division
0X0=0
0X1=0
1X0=0
1X1=1
2’S Complement of binary numbers: The 2’S complement of a binary number is obtained by adding
1 to the 1’s complement of the number.
Note: The 1’S complement and the 2’S complement of a binary number help to do the subtraction by
the method of addition.
BINARY CODES
Numeric Code:
Digital code represented by the number is known as a numeric code.
Classification:
1. Weighted code
2. Non-weighted code
3. Reflective code
4. Sequential code
3
S
5. Error detecting and correcting codes
Weighted codes:
The weighted codes are those where the position of each number represent a specific weight. In these
codes each decimal digit is represented by a group of four bits.
In weighted codes, each digit is assigned a specific weight according to its position. For example, in
8421/BCD code, 1001 the weights of 1, 1, 0, 1 (from left to right) are 8, 4, 2 and 1 respectively.
Examples:8421, 2421.
Non-weighted codes:
The non-weighted codes are not positionally weighted. In other words, codes that are not assigned with
any weight to each digit position.
Excess-3 code
Excess-3 codes are Non-weighted and can be obtained by adding 3 to each decimal digit then it can be
represented by using 4 bit binary number for each digit. An Excess-3 equivalent of a given binary
number is obtained using the following steps:
Gray code:
Gray code is non weighted code, which means there is no specific weight assigned to the bit position.
Applications:
It is used in analog to digital conversion, input / output devices.
It is used to reduce errors that occur in data transmission.
. MSB MSB
B3 G3
G2
B2
G1
B1
B0 G0
LSB LSB
0 1
0 0
LSB
Binary 1
1
5
S
Gray code 1 1 0 1
MSB LSB
LSB LSB
Gray code to binary conversion
The MSB of the binary is same as the MSB of gray code.
Perform the XOR operation between the MSB of the binary and the second significant bit of
gray code the result is the second significant bit of binary.
Perform the XOR operation between the second significant bit of binary and the third
significant bit of gray code the result is the third significant bit of binary.
Repeat the process until all the gray code bits are XOR.
MSB MSB
G3 B3
G2 B2
G1 B1
G0 B0
LSB
LSB
Reflective codes:
A code is said to be reflective when the code for 9 is the complement for the code 0, 8 for 1, 7 for 2, 6
for 3 and 5 for 4.
6
S
Sequential codes:
A code is said to be sequential when each succeeding code is binary number greater than its preceding
code.
Parity codes:
The parity code is used for the purpose of detecting errors during the transmission of binary
information. The parity code is a bit that is included with the binary data to be transmitted.
The inclusion of a parity bit will make the number of 1’s either odd or even. Based on the number of
1’s in the transmitted data, the parity code is of two types.
If the total number of 1 bits in the word including parity bit is Even, then such a parity code is said to
be Even parity code.
If the total number of 1 bits in the word including parity bit is odd, then such a parity code is said to be
odd parity code.
The following table shows the even and odd parity bits for 4 bit data word
Data Even parity Odd parity
0000 0 0
0001 1 0
0010 1 0
0011 0 1
0100 1 0
7
S
0101 0 1
0110 0 1
0111 1 0
1000 1 0
1001 0 1
The simple parity will not detect two errors within the same word. To detect and correct error in the
word Hamming code is used.
Hamming code:
Hamming code is a set of error-correction codes that can be used to detect and correct the errors that
can occur when the data is moved or stored from the sender to the receiver. It is technique developed
by R.W. Hamming for error correction.
Let n be the number of information or data bits, then the number of parity bits P is determined from
the following formula,
2P ≥ n + P + 1 Example:
If 4-bit information is to be transmitted, then n=4. The number of parity bits is determined by the trial
and error method
Let P=2, we get,
22 ≥ 4 + 2+ 1
The above equation implies 4 not greater than or equal to 7. So let’s choose another value of P=3.
23 ≥ 4 + 3+ 1
Now, the equation satisfies the condition. So number of parity bits, P=3.
The bit designation is
D7 D6 D5 P3 D1 P2 P1
Problem:
Data bits 1011 must be transmitted. Construct the even parity, seven bit Hamming code for this data
8
S
LOGIC GATES
Logic gate is an electronic circuit that performs a Boolean logical operation. A logic gate has
one or more inputs but only one output.
• The basic gates are AND gate, OR gate and NOT gate.
• The universal gates are NAND gate and NOR gate. The special
gates are XOR and XNOR.
OR gate:
OR gate is a basic gate which has two or more input but only one output. The output is high if any
one of the input is high.
Input Output
A A B Y = A+B
Y = A+B B 0 0 0
0 1 1
Logic symbol
1 0 1
1 1 1
Truth table
AND gate:
AND gate is a basic gate which has two or more input but only one output. The output is high if all
the inputs are high.
A
9
Input Output
S
A B Y = AB
Y= AB
0 0 0
B 0 1 0
1 0 0
Logic symbol 1 1 1
Truth table
NOT gate:
It is a basic gate which complements the input signal value. It is also called as an inverter. It is a
logic gate with only one input and one output.
Y = 𝐀̅
Input Output
A
Y = 𝐀̅
A
0 1
1 0
Logic symbol Truth table
NAND gate:
NAND gate is a universal gate which performs complement of AND logic. NAND gate has two or
more input but only one output. The output is high only when any of the input is low.
Y = ̅𝐀𝐁̅̅̅
A Inputs Output
B A B Y = ̅𝐀𝐁̅̅̅
Logic symbol 0 0 1
0 1 1
Truth table
1 0 1
1 1 0
10
NOR gate:
NOR gate is a universal gate which performs complement of OR logic. NOR gate has two or more
input but only one output. The output is high if and only if all the inputs are low.
Y = ̅𝐀̅̅̅+̅̅̅𝐁̅
Inputs Output
Y = ̅A̅̅+̅̅̅B̅
A
B A B
Logic symbol 0 0 1
0 1 0
1 0 0
Truth table
1 1 0
XOR gate is a special gate which has two or more input but only one output. The output is high only
when odd numbers of input are high.
XOR gate is also called as Inequality detector.
̅ 𝐁 + 𝐀̅ B Y = A B̅ + A̅ B
Or
B Y=A A B
0 0 0
Logic symbol
0 1 1
1 0 1
Truth table
1 1 0
Realization of NOT, AND, OR and XOR gates using NAND gate.
A
The NAND gate as an OR gate Y = A+B
B
̅A̅ ̅ ̅ ̅ ̅ A
̅ ̅B
̅
̅A̅ ̅ B
̅
A
The NAND gate as an XOR gate Y = A̅ B + A B̅
̅̅̅̅̅̅̅̅̅
B ̅AB̅̅̅
B
Page
A
The NOR gate as a AND gate Y = A.B
B
B
A
Product term: The logical product of Boolean variables, complemented or uncomplemented form is a product
term.
Example: A B̅ C, A B C, A B C̅, A B, A̅ B̅ etc
Example: A B̅ + C̅ A + A B
Sum of products (SOP): The logical sum of two or more logical product terms is known as sum of products.
Example: (A + B̅) (B + C) (A + B)
Product of sum (POS): The logical product of two or more logical sum terms is known as product of sum.
Canonical SOP (or) Standard SOP expression: The Boolean expression containing all the input
variables in each of the product term either in complemented or uncomplemented form is known as
canonical SOP expression.
Canonical POS (or) Standard POS expression: The Boolean expression containing all the input
variables in each of the sum term either in complemented or uncomplemented form is known as
canonical POS expression.
Page