DLD Bank
DLD Bank
DLD Bank
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.
32 + 0 + 8 + 4 + 0 + 1 = 45
ii) 1001.0101:
This binary number has a fractional part, so we'll convert both the
integer and fractional parts separately.
i) 10.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
ii) 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
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.
(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:
Y1=¯A
Y2=¯B
Y=¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯A+¯B=¯¯A⋅ ¯¯B=A⋅ B
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
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.
For 396:
- 3 in BCD is 0011.
- 9 in BCD is 1001.
- 6 in BCD is 0110.
For 396:
- 3 + 3 = 6 (binary 0110)
- 9 + 3 = 12 (binary 1100)
- 6 + 3 = 9 (binary 1001)
For 4096:
- 4 + 3 = 7 (binary 0111)
- 0 + 3 = 3 (binary 0011)
- 9 + 3 = 12 (binary 1100)
- 6 + 3 = 9 (binary 1001)
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
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
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.
Ans: To convert Gray codes into their equivalent binary codes, you can
use the following procedure:
i) 10110010
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
ii) 100010101010
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
iii) 1010000111100010
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