You are on page 1of 16

JSPM University, Pune

Faculty of Science and Technology


School of Computational Sciences & Mathematics
SY B. Tech [Lateral Entry]
ASSIGNMENT-01
Sub: - Digital Logic Design Div: -A,C,D,E

Faculty: -Ms. Isha Sood


Blooms
Que. No. Question Marks
Level
Solve any 5
a) Determine the decimal numbers represented by the following
3 2
binary numbers: i)101101 ii)1001.0101
Ans: To determine the decimal numbers represented by the given binary
numbers, you can use the following procedure:

1. i) 101101:

1. Convert the binary number to decimal. Start from the left and move
to the right, using powers of 2 for each bit position.

1 * 2^5 + 0 * 2^4 + 1 * 2^3 + 1 * 2^2 + 0 * 2^1 + 1 * 2^0

2. Calculate the values:

32 + 0 + 8 + 4 + 0 + 1 = 45

So, the decimal number represented by the binary number 101101 is


45.

ii) 1001.0101:

This binary number has a fractional part, so we'll convert both the
integer and fractional parts separately.

1. For the integer part, convert it to decimal as shown in part i):

1 * 2^3 + 0 * 2^2 + 0 * 2^1 + 1 * 2^0 = 8 + 0 + 0 + 1 = 9

2. For the fractional part, convert it to decimal by moving from left to


right, using negative powers of 2 for each bit position after the binary
point.

0 * 2^(-1) + 1 * 2^(-2) + 0 * 2^(-3) + 1 * 2^(-4)

3. Calculate the values:

0 + 0.25 + 0 + 0.0625 = 0.3125


Now, combine the integer and fractional parts:

9 (integer part) + 0.3125 (fractional part) = 9.3125

So, the decimal number represented by the binary number 1001.0101 is


9.3125.

Express the following decimal numbers in the binary form:


b) 2 2
i)10.625 ii)0.6875
Ans:
To express the given decimal numbers in binary form, you can convert
both the integer and fractional parts separately. Here are the binary
representations:

i) 10.625:

**Integer Part (10):**

Convert the integer part (10) to binary:

10 in decimal is 1010 in binary.

**Fractional Part (0.625):**

Convert the fractional part (0.625) to binary. Multiply the fractional part
by 2 and record the integer part of the result:

0.625 * 2 = 1.25
0.25 * 2 = 0.5
0.5 * 2 = 1.0

The fractional part in binary is 0.101.

Now, combine the binary representations of the integer and fractional


parts:

10 (integer part) + 0.101 (fractional part) = 1010.101

So, the binary representation of 10.625 is 1010.101.

ii) 0.6875:

**Integer Part (0):**

The integer part is 0, so the binary representation is simply 0.

**Fractional Part (0.6875):**

Convert the fractional part (0.6875) to binary using the same method as
in part i):
0.6875 * 2 = 1.375
0.375 * 2 = 0.75
0.75 * 2 = 1.5
0.5 * 2 = 1.0

The fractional part in binary is 0.1011.

Now, combine the binary representations of the integer and fractional


parts:

0 (integer part) + 0.1011 (fractional part) = 0.1011

So, the binary representation of 0.6875 is 0.1011.

c) Convert (6327.4051)8 into its equivalent decimal number. 3 2


Ans:
6327.4051 = (6 × 8³) + (3 × 8²) + (2 × 8¹) + (7 × 8⁰) + (4 × 8⁻¹) +
(0 × 8⁻²) + (5 × 8⁻³) + (1 × 8⁻⁴) = 3287.510009765625
Decimal No= 3287.510009765625
d) Convert (2F9A)16 into its equivalent binary and decimal
3 2
number.
Ans: 1. Binary:- Convert each hex digit to 4 binary digits (see
conversion table below):
2F9A
=2F9A
= 0010 1111 1001 1010
= 0010111110011010
2. Decimal:- (2F9A)₁₆ = (2 × 16³) + (15 × 16²) + (9 × 16¹) +
(10 × 16⁰) = (12186)₁₀
Decimal No:- (12186)₁₀

e) Find the 1’s complement of the following binary numbers:


2 2
i)0100111001 ii)11011010
Ans: i)
f) Find the 1’s complement of the following binary numbers:
2 2
i)10010010 ii)01100100

Solve any 2
Draw logic symbols and truth table for i) NAND and ii)
a) 3 3
XNOR Gate.
2. Ans: What is a NAND gate?
The NAND gate or “NotAND” gate is the combination of
two basic logic gates, the AND gate and the NOT gate
connected in series. The NAND gate and NOR gate can be
called the universal gates since the combination of these
gates can be used to accomplish any of the basic operations.
Hence, NAND gate and NOR gate combination can
produce an inverter, an OR gate or an AND gate.

Symbol and truth table of NAND gate


The symbol of the NAND gate is represented as a
combination of AND gate and NOT gate. The Boolean
expression is given as
What is an XNOR Gate?
An XNOR Gate is a type of digital logic gate that receives
two inputs and produces one output. Both inputs are treated
with the same logic, responding equally to similar inputs.
Sometimes referred to as an "Equivalence Gate," the gate's
output requires both inputs to be the same to produce a high
output.

Exclusive-NOR gate equivalent circuit


The Ex-NOR gate can be constructed by combining the OR gate, AND
gate and NOT gate.
Why NAND and NOR Gates are called as Universal Gates?
b) 3 3
Explain with suitable example.
Ans:
The NAND and NOR gates can perform all the other operations of
the gates such as logical AND, OR, and NOT gates.
The following figure shows the input output relation in NAND and
NOR gates.

(i) NOR gates can be converted into the NOT gate by just
connecting the inputs of a NOR gate. As a NOR gate is equivalent to
an OR gate leading to NOT gate, this is automatically seen to the
OR part of the NOR gate, eliminating it from consideration and
leaving only the NOT part.
(ii) To convert the NOR into the OR gate, connect by just
connecting the NOT gate followed to the NOR gate. As a result,
outputs of this gate are opposite to that of the OR gate when the
inputs are kept the same.
(iii) An AND gate gives the output as 1 when both of its inputs are
1. Therefore, an AND gate is made by inverting the inputs of a NOR
gate.
(iv) A NAND gate can be converted into the NOT gate, by just
connecting the inputs of NAND gates together.
(v) Not only AND, OR, and NOT gates, we can also combine the
NAND gates to perform the EX-OR and NOR operations too.
An example of X-OR gate construction using NAND gates is shown
below:

(vi) To construct each logic gate, we need specific IC’s. For


example, to construct the AND gate we need IC 7408. But if we
have the IC 7400 which is used to construct the NAND gate, we can
form any logic gate using that single type of IC. The same goes for
the NOR gate too.
c) Draw i) AND ii) OR iii) XOR gate using NOR gate. 3 3

I. Implementation of AND Gate from NOR Gate

As mentioned above that the NOR gate is a logic gate, therefore, we


may use it to realize an AND gate. The realization of an AND gate
from the NOR gates only is shown Figure-3.

Thus, for the realization of an AND gate from NOR gate, we


require 3 NOR gates. Where, the first two NOR gates are used to
complement the input variables A and B, and the third NOR gate is
used to produce an output equivalent to the AND operation.

The outputs of the first two NOR gates are,

Y1=¯A
Y2=¯B

The output of the third NOR gate is,

Y=¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯A+¯B=¯¯A⋅ ¯¯B=A⋅ B

ii.Implementation of OR Gate from NOR Gate

As we know, the NOR gate is a type of universal logic gate,


therefore, using NOR gates only, we can implement the OR
operation. The logic diagram of OR Gate using NOR Gate is
shown in Figure-3.Hence, from the logic circuit, it is clear that
we require only two NOR gates for the realization of OR
operation.

The first NOR gate performs the NOR operation on variables A


and B, thus the output of the first NOR gate is,

Y1=A+B¯

The second NOR gates perform the NOT operation on the output of
the first NOR gate. Therefore, the output of the second NOR gate
is,
Y=A+B

This is the output expression of an OR gate. Therefore, we can


realize an OR gate using NOR gates only as shown in Figure-3.

iii.Implementation of XOR Gate from NOR Gate

It takes at least five NOR gates to create the circuit diagram for an
XOR gate using only NOR gates. More than five NOR gates can
also contain an XOR gate. The schematic for an XOR gate
employing five NOR gates is shown in the accompanying figure.
Solve any 3
Represent the decimal numbers i)396 and ii)4096 in binary
a) 1 6
form in i) Binary Code ii) BCD Code iii) Excess-3 Code
Ans:
3. To represent the decimal numbers 396 and 4096 in binary
form in Binary Code (BCD), and Excess-3 Code, you can
follow these steps:

i) Binary Code:
1. Convert the decimal number to its binary representation.

For 396:
- 396 in binary is 110001100.

For 4096:
- 4096 in binary is 1000000000000.

ii) BCD Code (Binary Coded Decimal):


BCD represents each decimal digit with its 4-bit binary
equivalent. To convert a decimal number to BCD, represent
each decimal digit separately in 4-bit binary form.

For 396:
- 3 in BCD is 0011.
- 9 in BCD is 1001.
- 6 in BCD is 0110.

So, the BCD representation of 396 is 0011 1001 0110.


For 4096:
- 4 in BCD is 0100.
- 0 in BCD is 0000.
- 9 in BCD is 1001.
- 6 in BCD is 0110.

So, the BCD representation of 4096 is 0100 0000 1001 0110.

iii) Excess-3 Code:


Excess-3 Code (XS-3) is a binary-coded decimal
representation in which each decimal digit is represented by
adding 3 to its decimal value and then converting it to binary.

For 396:
- 3 + 3 = 6 (binary 0110)
- 9 + 3 = 12 (binary 1100)
- 6 + 3 = 9 (binary 1001)

So, the Excess-3 Code representation of 396 is 0110 1100


1001.

For 4096:
- 4 + 3 = 7 (binary 0111)
- 0 + 3 = 3 (binary 0011)
- 9 + 3 = 12 (binary 1100)
- 6 + 3 = 9 (binary 1001)

So, the Excess-3 Code representation of 4096 is 0111 0011


1100 1001.

b) Design 4-Bit Binary to Gray Code converter. 3 6

Ans: A 4-bit Binary to Gray Code converter can be designed using a


truth table and a Karnaugh map. Gray code is a binary numeral
system where two successive values differ in only one bit.
Here's a design for a 4-bit Binary to Gray Code converter:

Truth Table:
```
| Binary (B3 B2 B1 B0) | Gray (G3 G2 G1 G0) |
|----------------------|----------------------|
| 0000 | 0000 |
| 0001 | 0001 |
| 0010 | 0011 |
| 0011 | 0010 |
| 0100 | 0110 |
| 0101 | 0111 |
| 0110 | 0101 |
| 0111 | 0100 |
| 1000 | 1100 |
| 1001 | 1101 |
| 1010 | 1111 |
| 1011 | 1110 |
| 1100 | 1010 |
| 1101 | 1011 |
| 1110 | 1001 |
| 1111 | 1000 |
```

In this truth table, you can see the conversion from 4-bit binary
to 4-bit Gray code. To design a circuit that implements this
conversion, you can use logic gates or Karnaugh maps. Here's a
Karnaugh map for each output bit (G3, G2, G1, and G0) based
on the truth table:

Karnaugh Maps:
```
For G3 (Most Significant Bit):
B3 B2 | B1 B0 | G3
----------------------------------
0 | 0 | 0
0 | 1 | 1
1 | 0 | 1
1 | 1 | 0

For G2:
B3 B2 | B1 B0 | G2
----------------------------------
0 | 0 | 0
0 | 1 | 1
1 | 0 | 1
1 | 1 | 0
For G1:
B3 B2 | B1 B0 | G1
----------------------------------
0 | 0 | 0
0 | 1 | 0
1 | 0 | 1
1 | 1 | 1

For G0 (Least Significant Bit):


B3 B2 | B1 B0 | G0
----------------------------------
0 | 0 | 0
0 | 1 | 0
1 | 0 | 0
1 | 1 | 0
```

Using the Karnaugh maps, you can see the simplified logic
equations for each output bit:

G3 = B3 XOR B2
G2 = B2 XOR B1
G1 = B1 XOR B0
G0 = B0

You can implement these equations using logic gates to create a


4-bit Binary to Gray Code converter circuit.

List the applications of i) Gray Code ii) Excess-3 Code iii)


c) 1 6
BCD Code.
Ans:
Gray Code, Excess-3 Code, and BCD (Binary Coded Decimal) Code
have various applications in digital electronics and communication
systems. Here's a list of applications for each of them:

i) Gray Code:
1. **Rotary Encoders**: Gray code is commonly used in rotary
encoders to convert mechanical motion into digital signals. It ensures
that only one bit changes at a time, reducing errors caused by noise and
bouncing.

2. **Position Sensors**: In applications where precise position sensing


is critical, such as robotics and automation, Gray code is used to avoid
ambiguous states when determining position.
3. **Error Detection and Correction**: Gray code can be used for error
detection and correction, as it enables easy detection of bit errors when
data is transmitted or stored digitally.

4. **Analog-to-Digital Converters (ADCs)**: Gray code is used in


ADCs to reduce the likelihood of glitches during transitions, which can
cause errors in the digitized analog signal.

5. **Telecommunications**: Gray code can be used in digital


modulation and communication systems to minimize the probability of
symbol errors during transmission.

ii) Excess-3 Code (XS-3):


1. **Decimal-to-BCD Conversion**: Excess-3 code is used in decimal-
to-BCD conversion, where it facilitates the conversion of decimal
numbers to binary-coded decimal (BCD) format, making it suitable for
display and processing in digital systems.

2. **Calculator Displays**: Historically, excess-3 code was used in


early electronic calculators for internal representation and display of
decimal numbers. While less common today, it serves as a historical
example.

3. **Error Detection**: In some applications, excess-3 code can be


used for error detection, as errors in the code can indicate issues with
the original decimal data.

iii) BCD Code (Binary Coded Decimal):


1. **Decimal Arithmetic**: BCD is commonly used in digital systems
for performing decimal arithmetic, especially in applications where
exact decimal representation is important, such as financial
calculations, timekeeping, and instrumentation.

2. **Seven-Segment Displays**: BCD is often used to drive seven-


segment displays, which are commonly found in digital clocks,
calculators, and other devices for displaying numbers and digits.

3. **Data Entry and Keyboards**: In applications involving numerical


data entry, like numeric keypads or PIN entry, BCD is used to represent
the digits for easy processing and display.

4. **Barcode Encoding**: BCD encoding can be used in barcode


systems for encoding digits, particularly in older barcode systems.

5. **Error Detection**: BCD can be used for error detection and


correction in applications where decimal data needs to be protected
from errors during transmission or processing.

While these codes may not be as prevalent in modern computing as


binary and other more efficient encoding schemes, they still find niche
applications where their unique properties are advantageous.

Convert the following gray codes into its equivalent binary


d) 3 6
codes: i)10110010 ii)100010101010 iii)1010000111100010

Ans: To convert Gray codes into their equivalent binary codes, you can
use the following procedure:

i) 10110010

To convert the Gray code "10110010" into its binary equivalent:

1. Write down the first bit of the Gray code as is.


Binary: 1

2. For the remaining bits, XOR each bit of the Gray code with the
previously calculated binary bit.

- XOR(0, 1) = 1
- XOR(1, 0) = 1
- XOR(0, 1) = 1
- XOR(1, 0) = 1
- XOR(0, 1) = 1
- XOR(1, 0) = 1
- XOR(0, 1) = 1

So, the binary equivalent of Gray code "10110010" is "11111111."

ii) 100010101010

To convert the Gray code "100010101010" into its binary


equivalent, follow the same procedure:

1. Write down the first bit of the Gray code as is.


Binary: 1

2. For the remaining bits, XOR each bit of the Gray code with the
previously calculated binary bit.

- XOR(0, 1) = 1
- XOR(1, 0) = 1
- XOR(0, 1) = 1
- XOR(1, 0) = 1
- XOR(0, 1) = 1
- XOR(1, 0) = 1
- XOR(0, 1) = 1
- XOR(1, 0) = 1
- XOR(0, 1) = 1

- XOR(1, 0) = 1

So, the binary equivalent of Gray code "100010101010" is


"11111111111."

iii) 1010000111100010

To convert the Gray code "1010000111100010" into its binary


equivalent, follow the same procedure:

1. Write down the first bit of the Gray code as is.


Binary: 1

2. For the remaining bits, XOR each bit of the Gray code with the
previously calculated binary bit.

- XOR(0, 1) = 1
- XOR(1, 0) = 1
- XOR(0, 1) = 1
- XOR(1, 0) = 1
- XOR(0, 1) = 1
- XOR(1, 0) = 1
- XOR(0, 1) = 1
- XOR(1, 0) = 1
- XOR(0, 1) = 1
- XOR(1, 0) = 1
- XOR(0, 1) = 1
- XOR(1, 0) = 1
- XOR(0, 1) = 1
- XOR(1, 0) = 1

So, the binary equivalent of Gray code "1010000111100010" is


"1111111111111111."

You might also like