Can someone help me design a gate level circuit and model using HDL? It needs to convert 3-bit gray code to a binary number representation 2) adds the gray code input to its binary representation3) includes a flag(output)to determine when an overflow occurs.
For example 111 in gray code is 5 in base 10, the binary representation for 5 is 101, the sum is 1100, an overflow has occurred and the overflow bit is set to 1.
You will show as timing diagram outputs,1)the inputs, 2) the converted binary representation, 3) the resulting sum, and 4) the overflow flag.
Structure: (Using XOR Gate)
Truth table:
G1 | G2 | G3 | B1 | B2 | B3 |
0 | 0 | 0 | 0 | 0 | 0 |
1 | 0 | 0 | 0 | 0 | 1 |
1 | 1 | 0 | 0 | 1 | 0 |
0 | 1 | 0 | 0 | 1 | 1 |
0 | 1 | 1 | 1 | 0 | 0 |
1 | 1 | 1 | 1 | 0 | 1 |
1 | 0 | 1 | 1 | 1 | 0 |
0 | 0 | 1 | 1 | 1 | 1 |
VHDL Code:
library ieee;
entity G2B is
port(
gray:in bit_vector(2 downto 0);
bin:out bit_vector(2 downto 0)
);
end G2B;
architecture dataflow of G2B is
begin
bin(2)<=gray(2);
bin(1)<=gray(2) xor gray(1);
bin(0)<=gray(3) xor gray(2) xor gray(1) xor gray(0);
end dataflow;
Timing Diagram:
Can someone help me design a gate level circuit and model using HDL? It needs to...
Building and testing basic combinational circuits using Verilog HDL Description: Build and test the following circuits using gate-level modeling in Verilog HDL 1.3-input majority function 2.Conditional inverter (see the table below: x - control input, y -data input). Do NOT use XOR gates for the implementation. Output 3. Two-input multiplexer (see the table below: x.y -data inputs, z- control input) Output 4. 1-bit half adder. 5. 1-bit full adder by cascading two half adders 6.1-bit full adder directly (as in...
Please code the following in Verilog: Write the HDL gate-level hierarchical description of a four-bit adder-subtractor for unsigned binary numbers similar to the following circuit. You can instantiate the four-bit full adder described in the following example code Figure 4.13a, 4-Bit adder-subtractor without overflow Inputs: 4-Bit A, 4-Bit B, and Mode M (0-add/1-subtract) Interfaces: Carry Bits C1, C2, C3 Outputs: Carry C (1 Bit, C4), Sum S (4 bit) Bo A FA FA FA FA module Add half (input a,...