0% found this document useful (0 votes)
8 views35 pages

Number System Conversions and Codes Guide

The document covers various topics related to number systems, including conversions between hexadecimal and decimal, gray code, Hamming codes, and Boolean algebra. It explains error detection and correction methods, logic gate implementations, and the simplification of Boolean expressions. Additionally, it discusses the binary number system and provides examples and exercises related to these concepts.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views35 pages

Number System Conversions and Codes Guide

The document covers various topics related to number systems, including conversions between hexadecimal and decimal, gray code, Hamming codes, and Boolean algebra. It explains error detection and correction methods, logic gate implementations, and the simplification of Boolean expressions. Additionally, it discusses the binary number system and provides examples and exercises related to these concepts.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Number System

Module - 3
Part - A
1Q) Convert the following Hexadecimal number to their Decimal
equivalent (EAF 1)16

Given;
Hexadecimal number: (EAF 1)16
To convert it into decimal: (?)10

So,
(E)16 = (1110)2 = (14)10 = 14 × 163 = 57344

(A)16 = (1010)2 = (10)10 = 10 × 162 = 2560

(F )16 = (1111)2 = (15)10 = 15 × 161 = 240

(1)16 = (0001)2 = (1)10 = 1 × 160 = 1

and sum of all values is: 57344 + 2560 + 240 + 1 =


(60145)10

2Q) What is the gray code equivalent of the Hex Number 3A7.
Find 9’s complement of (25.639)10 .

Hex Code to Gray Code:


Hexadecimal number: (3A7)16

Number System 1
To convert it into gray code: (?)
So,
(3)16 = (0011)2 = (0010)

(A)16 = (1010)2 = (1111)

(7)16 = (0111)2 = (0100)

Gray code for (3A7)16 is: 001011110100 Doubt!!!!!

9′ s complement of (25.639)10 :
Subtracting the given number with 9:
99.999 − 25.639 = 74.360
∴ (25.639)10 = (74.360)9
3Q) Implement 7 bit hamming code for given message 1010 by
using odd parity.

Given,
(1010)2
and hamming code: 101R4 0R2 R1
R1 (1, 3, 5, 7) = 1′ s [count = (2 even )] = 1
Hamming code: 101R4 0R2 1
R2 (2, 3, 6, 7) = 1′ s [count = (1 odd)] = 0
Hamming code: 101R4 001
R4 (4 − 7, 12 − 15) = 1′ s [count = (2 even)] = 1
Final 7 bit odd parity code is:
1011001
4Q) Perform the subtraction using 1’s complement and 2’s
Complement
i). (11010)2 – (10000)2

Number System 2
ii). (1000100)2 – (1010100)2

i)(11010)2 − (10000)2
1′ s complement:
= (11010)2 + (01111)2
= 1 (01001) ∴ carry has been generated
= (01001) + 1 = (01010)
∴ 1′ s complement = 01010
2′ s complement:
= (11010)2 + (01111 + 1)2
= (11010)2 + (10000)2
= 1 (01010)2 ∴ Carry bit has been generated
= (01010)2
∴ 2′ s complement = 01010

ii)(1000100)2 − (1010100)2
1′ s complement:
= (1000100)2 + (0101011)2
= (1101111)2
∴ 1′ s complement = 1101111
2′ s complement:
= (1000100)2 + (0101011 + 1)2
= (1000100)2 + (0101111)2
= (1110011)2
∴ 2′ s complement = 1110011
5Q) Convert following hexadecimal number to decimal:
i) (F 28)16

ii) (BC2)16

Number System 3
i) (F 28)16

(F )16 = (1111)2 = (15)10 = 15 × 162 = 3840

(2)16 = (0010)2 = (2)10 = 2 × 161 = 32

(8)16 = (0100)2 = (8)10 = 8 × 160 = 8

So, sum of all values: 3840 + 32 + 8 = (3880)10

ii) (BC2)16

(B)16 = (1011)2 = (11)10 = 11 × 162 = 2816

(C)16 = (1100)2 = (12)10 = 12 × 161 = 192

(2)16 = (0010)2 = (2)10 = 2 × 160 = 2

So, sum of all values: 2816 + 192 + 2 = (3010)10

6Q) Implement Y = AB′ + A′ B using 2 input NAND gates.

Number System 4
7Q) Simplify using postulates and theorems of Boolean algebra
i)(X + Y ′ + XY )(X + Y ′ )(X ′ Y )
ii)(AB + C + D)(C ′ + D)(C ′ + D + E)

Number System 5
8Q) For each of the following expressions, construct the
corresponding logic using AND/OR/INV ERT logic

Number System 6
i)Y = AB(C + D)
ii)Z = (W + P Q′ )′

9Q) Implement Y = AB′ + A′ + B using 2 input NOR gates.

10Q) Realize XOR operation


a)NAND gates
b)NOR gates

An XOR gate is made by connecting four NAND gates

An XOR gate is made by connecting the output of 3 NOR


gates (connected as an AND gate) and the output of a NOR
gate to the respective inputs of a NOR gate.

Number System 7
Part - B
1Q) Explain error occurred in data transmission can be detected
using parity bit?

The circuit which adds a parity bit to the data at transmitter is


called “Parity generator”. The parity bits are transmitted and they
are checked at the receiver. If the parity bits sent at the
transmitter and the parity bits received at receiver are not
equal then an error is detected.

2Q) Define weighted codes and non weighted codes with


examples?

Weighted Codes:
Weighted binary codes are those binary codes which obey the
positional weight principle. Each position of the number
represents a specific weight. Several systems of the codes are
used to express the decimal digits 0 through 9. In these codes
each decimal digit is represented by a group of four bits.

Non Weighted Codes:


In this type of binary codes, the positional weights are not
assigned. The examples of non-weighted codes are Excess-3
code and Gray code.

3Q) Explain what do you mean by error detection and correcting


code with examples.

Number System 8
Error detection and correction or Error control are techniques that
enable reliable delivery of digital data over unreliable channel or
medium. Many communication channels are subjected to channel
noise.

Error detection codes: Are used to detect the errors present in


the received data (bitstream). These codes contain some bits,
which are appended to the original bit stream. These codes
detect the error, if it is occurred during transmission of the original
data.
Example: Parity code, Hamming code.
Error correction codes: Are used to correct the errors present in
the received data (bitstream) so that, we will get the original
data.
Example: Hamming code

4Q) Explain the gray to binary and binary- to- gray conversion
with examples.

Using Exclusive OR ⊕ Binary code can be converted into Gray


code and vice versa
Binary to Gray:

Number System 9
Here b2 b1 b0 So,
to get g2 g1 g0 the following need to be performed
g2 = b2
g1 = b2 ⊕ b1
g0 = b1 ⊕ b0

Gray to Binary:

Here g2 g1 g0 So,
to get b2 b1 b0 the following need to be performed
b2 = g2
b1 = g2 ⊕ g1
b0 = g2 ⊕ g1 ⊕ g0
5Q) Explain the conversion of AND/OR/NOT logic to NAND/ NOR
logic with example.

NOT - NAND

Number System 10
AND - NAND

OR - NAND

Number System 11
NOT - NOR

AND - NOR

OR - NOR

Number System 12
6Q) Explain Self complemented codes

Self Complementing Codes:


Self-complementing binary codes are those whose members
complement on themselves. For a binary code to become a self-
complementing code, the following two conditions must be
satisfied:
1. The complement of a binary number should be obtained
from that number by
replacing 1’s with 0’s and 0’s with 1’s (already stated
procedure).
2. The sum of the binary number and its complement should
be equal to decimal 9.

Examples: Excess-3, 8421 and 2421 weighted codes.

MORE ig

7Q) Differentiate between BCD code and 2421 code and


XS − 3.

BCD - Binary Coded Decimal


→ A decimal number is represented by 4 − binary weighted
code.

Number System 13
2421
→ Weighted code similar to BCD in functionality where 6 is
represented as 1100 and 3 as 0011

XS − 3 - Excess - 3
→ 3 is added to each individual digit of a decimal number. Non
weighted code

8Q) Solve the given 8 − bit data word (01011011), generate the
12 − bit composite word for the hamming code that corrects

Number System 14
and detects signal errors.

Given 8 − bit data (01011011)2 the hamming code would be


0101R8 101R4 1R2 R1
For R1 (1, 3, 5, 7, 9, 11) = 1′ s count = 5 odd = 0
Hamming Code: 0101R8 101R4 1R2 0
For R2 (2, 3, 6, 7, 10, 11) = 1′ s count = 3 odd = 0
Hamming Code: 0101R8 101R4 100
For R4 (4 − 7, 12 − 15) = 1′ s count = 2 even = 1
Hamming Code: 0101R8 1011100
For R8 (8 − 15) : 1′ s count = 2 even = 1
Hamming Code: 010111011100

∴ The required 12 − bit Hamming Code is: 010111011100


9Q) Write the first 10 decimal digits in base 3 and base 16

Base 3:
0000: 1
0010: 3
0010:
Incomplete

10Q) A device transmits the binary data using even parity, the
message is 1011001. Identify whether receiver receives correct
data or not.

The Data received from the transmitter is correct since its using
even parity and the number of 1s in the given binary are 4 which
is even.
or,
Since here the LSB bit has 1 and the main data have 1s count of

Number System 15
3 which combines to a count of 4 for number of 1s present in
given binary.

11Q) Convert the given expression in standard POS(Product of


Sums) form Y = (A + B)(B + C)(A + C)

The given expression is in the form of Product of Sums

12Q) Give the Boolean expression, symbols and truth table for
following gates.
i) AND
ii) NOR
iii)XOR
iv)OR
v)XNOR

i)

ii)

Number System 16
iii)

iv)

Number System 17
v)

13Q) Implement all the logic gates using NAND gate.

I) AND

Number System 18
II) OR

III) NOT

IV ) X-OR

Number System 19
V ) NOR

V I) X-NOR

14Q) Construct all logic gates using NOR gate.

I) AND

Number System 20
II) OR

III) NOT

IV ) X-NOR

Number System 21
V )X-OR

V I)NAND

15Q) Solve the canonical SOP(Sum Of Products) form of the


following functions.
i) Y (A, B) = A + B
ii)Y (A, B, C, D) = AB + ACD

16Q) Simplify the expression Z = AB + AB′ (A′ C ′ )′

17Q) Simplify the following 3 variable expression using Boolean


algebra Y = πM(3, 5, 7)

Number System 22
18Q) Simplify the following 4 variable expression using Boolean
algebra Y = ∑ m(1, 3, 5, 7)

19Q) Explain standard SOP and POS forms with examples

SOP:
The sum-of-products (SOP) form is a method (or form) of
simplifying the Boolean expressions of logic gates. The
sum-of-products form is also called as Disjunctive Normal Form
as the product terms (AND) are added (OR) together and
Disjunction operation is logical OR. Sum-of-products form is also
called as Standard SOP and uses minterms.

POS:
The product of sums form is a method (or form) of simplifying the
Boolean expressions of logic gates. In this POS form, all the
variables are added (OR), i.e. written as sums to form sum
terms. All these sum terms are multiplied (AND) together to get
the product-of-sum form. Product-of-Sums use maxterms

20Q) State and prove Boolean theorems and properties.

Boolean algebraic theorems are the theorems that are used to


change the form of a Boolean expression. Sometimes these
theorems are used to minimize the terms of the expression, and
sometimes they are used just to transfer the expression from one
form to another.

De-Morgan’s Law:
(A.B)’ = A’ + B’
(A + B)’ = A’.B’

Number System 23
Transposition Theorem:
AB + A’C = (A + C)(A’ + B)

Redundancy Theorem:
AB + BC’ + AC = AC + BC’

Duality Theorem:
A(B + C) = A + (B.C) = (A + B)(A + C)

Complementary Theorem:
A(B + C) = A′ + (B ′ .C ′ ) = (A′ + B ′ )(A′ + C ′ )

Part - C
1Q) Write short notes on binary number system.

The binary number system, also called the base-2 number


system, is a method of representing numbers that counts by
using combinations of only two numerals: zero (0) and one (1).
Computers use the binary number system to manipulate and
store all of their data including numbers, words, videos, graphics,
and music.

2Q) Explain 1′ s and 2′ s complement.

1′ s Complement:
To convert a binary into 1’s complement, invert the given binary.
You can implement logic circuit using only NOT gate for each bit
of Binary input.

2′ s Complement:

Number System 24
To convert a binary into 1’s complement, invert the given binary,
then add 1 to LSB(Least Significant Bit).

3Q) Discuss octal number system.

Octal Number System has a base of eight and uses the number
from 0 to 7. The octal numbers, in the number system, are
usually represented by 3 - bit binary (Since, number of binary bits
required for representing numbers from 0 − 7 are 3 where 0 −
(000) and 7 − (111)). For example, (12)8 is expressed as
(001010)2 , where 1 is equivalent to 001 and 2 is equivalent to
010.
4Q) Convert the given octal numbers into binary, decimal and
hexadecimal numbers
i)(45.5)8

ii)(32.2)8

i) (45.5)8

ii) (32.2)8

Number System 25
5Q) Show an example to convert gray code to binary code.

Gray to Binary:

Here g2 g1 g0 So,
to get b2 b1 b0 the following need to be performed
b2 = g2
b1 = g2 ⊕ g1
b0 = g2 ⊕ g1 ⊕ g0

6Q) Describe a short note on four bit BCD codes.

BCD - Binary Coded Decimal, where each digit of a decimal


number is represented by its equivalent binary number.

Number System 26
Converting 30 from binary to its BCD where we consider 4 bit
equivalent of 3 and 0.

7Q) Illustrate about unit - distance code? State where they are
used.

Number System 27
Unit Distance Code is an unweighted code that changes at only
one digit position when going from one number to the next in a
consecutive sequence of numbers.
Use of one of the many unit-distance codes can minimize errors
at symbol transition points when converting analog quantities
into digital quantities.
An example of a unit-distance code is the Gray code.

8Q) List the applications of error correcting codes.

Applications of Error Correcting Codes is as follows:


→ Internet
→ Deep - Space telecommunications
→ Satellite Broadcasting
→ Data Storage
→ Error Correcting in memory devices

9Q) Convert 10101101.0111 to octal equivalent and


hexadecimal equivalent.

10Q) Give the examples of unit distance codes

Number System 28
Example for unit distant code (un weighted code) is gray code.

11Q) Which gates are called as universal gates

NAND and NOR gates are known to be universal gates as we


can build any known logic gate (AND, NOR, OR, etc,.).

12Q) State DeMorgan's Theorem

De Morgan's law: The complement of the union of two sets is


equal to the intersection of their complements and the
complement of the intersection of two sets is equal to the union of
their complements.

13Q) State Duality theorem

A theorem concerning the relationship between the


solutions of primal and dual linear-programming problems.

Number System 29
Another form of the theorem states: if both problems have
feasible solutions, then both have finite optimal solutions, with the
optimal values of their objective functions equal

Doubt!!!!

14Q) Draw the symbols and truth tables of XOR and XNOR gates

15Q) Define sum of products and product of sum

Number System 30
SOP - Sum of Products
SOP is a Boolean algebra expression which deals with
minterms. In this, the different product inputs are being added
together. The product of inputs is Boolean logical AND whereas
the sum or addition is Boolean logical OR.

POS - Product of Sums


POS is a Boolean algebra expression which deals with
maxterms.1 In this, the different sum inputs are being multiplied
together. The sum of inputs is Boolean logical AND whereas the
sum or addition is Boolean logical OR.

16Q) State and prove the distributive property of Boolean


algebra.

Distributive Property:
i)A(B + C) = AB + AC
ii)A + (BC) = (A + B)(A + C)

Proof:
From i)
consider RHS
= AB + AC
= A(B + C)
∴ LHS = RHS

From ii)
consider RHS
= (A + B)(A + C)
= A∗A+A∗C+B∗A+B∗C
= A + A ∗ C + A ∗ B + B ∗ C (∴ A ∗ A = A, B ∗ A =

Number System 31
A ∗ B)
= A(1 + C + B) + B ∗ C
= A + BC (∴ 1 + B + C = 1)
∴ LHS = RHS

17Q) Simplify ABC + AB′ C + ABC ′

18Q) Convert the given expression in standard SOP form Y =


AC + AB + BC

The given expression is in Sum of Products format

19Q) Convert the given expressions in standard POS form Y =


(A + B)(B + C)(A + C)

The given expression is in the form of Product of Sums

20Q) List out the basic logic gates with truth table.

I) AND

II)

Number System 32
III)

IV )

V)

Number System 33
V I) Exclusive OR

V II) Exclusive NOR

Number System 34
Number System 35

Common questions

Powered by AI

Constructing an XOR operation using only NAND or NOR gates involves configuring the universality of these gates to mimic XOR's exclusivity properties. For NAND, an XOR can be achieved with four interlinked gates, where outputs conditional on input interactions closely replicate XOR logic. Similarly, XOR with NOR involves three NOR gates first mimicking AND, then outputs combined to behave as XOR through calculated interconnectivity, illustrating the gates' adaptability to complex logic.

To convert a hexadecimal number to Gray code, first, the hexadecimal number is converted to its binary equivalent. Each bit of the resulting binary number is then exclusive-ORed with the next bit to its right. For (3A7)16, the conversion process involves calculating each transition from the most significant bit using the custom method of binary to gray conversion but was uncompleted in the attempted source, raising a doubt.

To convert a binary number to Gray code, the most significant bit (MSB) remains the same. Each following bit in the Gray code is obtained by exclusive-ORing the current binary bit with the preceding binary bit. The reverse involves taking the MSB of Gray as the binary MSB, then each subsequent binary bit is calculated by exclusive-ORing the previous binary bit with the current Gray code bit. For example, binary (1011) converts to Gray as (1110). Conversely, Gray (1110) to binary is (1011)

To convert a hexadecimal number to its decimal equivalent, each digit is multiplied by 16 raised to the power of its position from right (starting from 0). For example, the hexadecimal number (EAF1)16 converts to decimal as follows: (E) = 14 in decimal, multiplied by 16^3 (57344); (A) = 10 in decimal, multiplied by 16^2 (2560); (F) = 15 in decimal, multiplied by 16^1 (240); and (1) = 1 in decimal, multiplied by 16^0 (1). Summing these values gives the decimal equivalent (60145)10.

To implement a 7-bit Hamming Code, you calculate and insert parity bits into the original message bits at specific positions to ensure odd parity. For a message '1010', you insert parity bits such that the number of 1s including parity bits becomes odd. Parity bits are calculated based on subsets of the bits where each subset covers the positions corresponding to the binary indices of the parity bits. An error can be detected and possibly corrected by evaluating these parity bits.

Weighted binary codes assign positional weights to each digit of the number, such as Binary Coded Decimal (BCD), which represents decimal digits through a group of four bits. Non-weighted codes, like Excess-3 or Gray code, do not assign positional weights, and their design rules are based on other criteria without fixed weights for positions. These code structures simplify certain operations or highlight specific properties useful in digital systems.

Any logical operation (AND, OR, NOT) can be generalized using NAND or NOR gates due to their universal properties. For instance, NOT can be implemented with a NAND gate by tying both inputs together, yielding a functional inversion. This flexibility is crucial in designing simplified circuits to economically substitute multi-gate operations with a single type of gate like NAND or NOR. For AND, a double-layer of NANDs achieves the same, and similarly for OR with NOR.

Self-complementary codes are designed such that the complement of a code word is achieved by a simple logical operation on its bits, usually by swapping 1s and 0s, and the resulting number's complement with the original sums to a fixed value like 9. Examples include Excess-3 and 2421 codes, both of which provide straightforward conversions between binary and their complements, useful for computational simplicity in digital systems.

Parity bits are used in data transmission to detect errors by appending an additional bit to the data stream. At the transmitter's end, a parity generator creates a parity bit based on either odd or even parity. The receiver checks the parity of received data against the expected parity. An error is detected if there is a mismatch between the sent and received parity bits, indicating a potential error during transmission. This simple error detection mechanism is crucial for maintaining data integrity.

In Boolean algebra, SOP (Sum of Products) combines minterms using OR operations, whereas POS (Product of Sums) combines maxterms using AND operations. The SOP form is often used for circuit implementation due to minimal product terms, suitable for AND-OR logic. Conversely, POS is used to express a Boolean expression using a series of sums multiplied together, often preferred where NOR gates are used predominantly. For example, SOP: ABC + A'BC'; POS: (A+B)(B'+C)

You might also like