Answer 1)
VHDL Code for the 3 bit equality comparator is below:
-- In the 1 bit exnor gate, when the two inputs A abd B are
equal then we get the Y = '1';
-- so we will use this feature of exnor gate to form a 3 bit
comparator
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
entity comparator is
port(
A : in std_logic_vector (2 downto 0);
B : in std_logic_vector (2 downto 0);
Y : out std_logic
);
end comparator;
architecture behave of comparator is
signal eq0, eq1, eq2 : std_logic;
begin
eq2 <= not (A(2) xor B(2));
eq1 <= not (A(1) xor B(1));
eq0 <= not (A(0) xor B(0));
-- all of the bits are equal then only Y = '1' else not
Y <= eq0 and eq1 and eq2;
end behave;
VHDL Testbench code for the above design code is:
library ieee;
use ieee.std_logic_1164.all;
entity comparator_tb is
end comparator_tb;
architecture behavior of comparator_tb is
component comparator
port(
A : in std_logic_vector(2 downto 0);
B : in std_logic_vector(2 downto 0);
Y : out std_logic
);
end component;
--Inputs
signal A : std_logic_vector(2 downto 0) := (others =>
'0');
signal B : std_logic_vector(2 downto 0) := (others => '0');
--Outputs
signal Y : std_logic;
begin
-- Instantiate the Unit Under Test (UUT)
uut: comparator port map (
A => A,
B => B,
Y => Y
);
-- Stimulus process
stim_proc: process
begin
A <= "001"; B <= "001"; wait for 50 ns;
A <= "101"; B <= "011"; wait for 50 ns;
A <= "110"; B <= "110"; wait for 50 ns;
A <= "010"; B <= "100"; wait for 50 ns;
wait;
end process;
end;
Wave form for the output :-
A Y = A ® B 1 1 1 1 1 Apply the idea of the truth table above and design a 3-bit comparator using XOR or XNOR gates of...
A Y = A+ B 1 1 1 1 1 1 Apply the idea of the truth table above and design a 3-bit comparator using XOR or XNOR gates of your choice. The design should be able to determine the equality between two 3-bit words. An LED should be turned ON only when every bit in "Word A" matches every corresponding bit in "Word B". Otherwise, the LED has to be OFF Hint for I/O port Definitions: Port Name MSB...
A Y = A ® B 0 1 1 1 0 1 1 1 Apply the idea of the truth table above and design a 3-bit comparator using XOR or XNOR gates of your choice. The design should be able to determine the equality between two 3-bit words. An LED should be turned ON only when every bit in "Word A" matches every corresponding bit in "Word B".Otherwise, the LED has to be OFF Hint for I/O port Definitions: MSB...
A Y = A ® B 1 1 1 0 0 1 1 1 Apply the idea of the truth table above and design a 3-bit comparator using XOR or XNOR gates of your choice. The design should be able to determine the equality between two 3-bit words. An LED should be turned ON only when every bit in "Word A" matches every corresponding bit in "Word B". Otherwise, the LED has to be OFF. Hint for I/O port Definitions:...
1. What logic gates are known as universal gates? (1 point) a) nand, nor b) and, or, not c) nand, nor, xor, xnor d) None of the above 2. Write the half adder truth table. (4 points) 3. Fill in the blank. (1 point) A2 to 1 mux has input lines. 4. True or False? (1 point) A Boolean algebraic sum of products expression is the complement of the product of sums expression. 5. What is the minimum POS expression...
A comparator circuit has two 1-bit inputs A and B and three 1-bit outputs G (greater), E (equal), and L (less than). That is, G is 1 if A > B (0 otherwise), E is 1 if A == B (0 otherwise), and L is 1 if A < B (0 otherwise). a. Draw the truth table for a 1-bit comparator (the table has 2 inputs and 3 outputs). b. Implement G, E, and L circuits using only...
(1)Try to use NAND gates to achieve the truth table function of an XOR gate (2) Try to design a clicker for three people, it just needs two people to agree to pass. A,B,C indicate the people, 0 means don't agree, 1 means agree. If it passes the result is 1. Please write the truth table, the SOP (sum of products) equation and draw the logic circuit for it. (3)Use a Karnaugh-map to simplify the following Boolean function: F= AB'C'+A'B'C'+AB'C+A'B'C+AB...
Plz explain. I will rate. True/False: a) Given the following Truth table for a 2 bit comparator: G-greater than, E-Equal to A1 AO B1 BO GI E 11 00 0 1 10 01 1 0 (True / False) b) X (X+Y)= XY (True / False) c) A + BC = (A+B) (A+C) (True / False) d) Voltage Regulator IC 7805 has 3pins with: Pin1 - Input, Pin2 - Output, Pin3 - Ground (True / False) e) OR and NOT gates...
Some questions may require well bulum 1. HDL stands for? a. Hardware Design Language b. Hardware Development Language c. Hardware Description language d. Hot Dry Land 2. What is the basic building unit of a VHDL design? a. Blocks b. Cubes c . Dices d. Bricks 3. What reserved word do all VHDL entities end with? a. entity b. use c. port d. end d. IEEE 4. Which block describes a design's interface? a. entity b. architecture c. library 5....
Design a 4-bit ALU with the truth table above. In this design A and B are two 4-bit binary inputs, s0, s1, s2, s3 and Cin are control signals. There is no need to draw the internal circuits of MUX & Full adders but I need the logic gates drawn out. S3 S2 s1 Cin Operation 0 A 0 0 0 1 A+1 0 0 1 10 A+B 0 1 1 A+B+1 A+B 0 0 0 0 0 A+B'+1 0...
Simulate the following truth table using a 2:1 MUX and other logic gates. A B C Y 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1