Comparator 1-Bit
Comparator 1-Bit
Q) Design 1-Bit Comparator using dataflow modelling style and write its VHDL code.
Simulate using XILINX ISE 14.5 Software.
Aim: To write and simulate the VHDL code for 1-bit comparator using dataflow modelling style
and simulate using Xilinx ISE 14.5 software and verifies its functionality.
Equipment Required:
1. Personal Computer
2. Xilinx ISE Software
Theory:
A comparator used to compare two bits is called a single bit comparator. It consists of
two inputs each for two single-bit numbers and three outputs to generate less than,
equal to and greater than between two binary numbers
Block Diagram:
Logic Diagram:
Truth Table:
INPUTS OUTPUTS
A B G (A>B) L (A<B) E (A=B)
0 0 0 0 1
0 1 0 1 0
1 0 1 0 0
1 1 0 0 1
Output Expressions:
G = A AND (NOT B)
L= (NOT A) AND B
E= A XNOR B
Procedure:
1. Click on the Xilinx ISE icon on the desktop of the PC. Project Navigator opens.
2. Create New Project from File Menu. Give the file name and choose HDL as Top Level
Source Type.
3. Create New Source by clicking on Project. Select VHDL Module and name the file.
Assign Input and Output pins.
4. VHDL code is presented on the screen. Now we just need to write the code in
architecture.
5. Select New Source by clicking on project source and then select Test Bench Waveforms
and name the file.
6. A new window will appears. For combinational circuits select combinatorial clock.
7. Set the input waveforms by clicking on the waveforms at different time intervals.
8. Select Behavioral Simulation from sources window.
9. Now in the process window click on Xilinx ISE Simulator. Check syntax and then
Simulate Behavioral Model.
10. Simulation window opens verify input and output waveforms according truth table.
11. View RTL Synthesis.
VHDL CODE:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity FULLADDER is
Port ( A,B : in STD_LOGIC;
G, L,E : out STD_LOGIC);
end FULLADDER;
Outputs:
Simulation Waveform:
Result: The Truth table of 1-Bit comparator verified using Xilinx 14.5 software.