Design of 4 Bit Comparator using IF-ELSE Statements (Behavior Modeling Style) -
Output Waveform : 4 Bit Comparator |
VHDL Code -
-------------------------------------------------------------------------------
--
-- Title : comparator_4bit
-- Design : vhdl_upload 1
-- Author : Naresh Singh Dobal
-- Company : nsdobal@gmail.com
-- VHDL Tutorials & exercise by Naresh Singh Dobal
-------------------------------------------------------------------------------
--
-- File : 4 bit comparator using if else.vhd
library IEEE;
use IEEE.STD_LOGIC_1164.all;
entity comparator_4bit is
port(
a : in STD_LOGIC_VECTOR(3 downto 0);
b : in STD_LOGIC_VECTOR(3 downto 0);
equal : out STD_LOGIC;
greater : out STD_LOGIC;
lower : out STD_LOGIC
);
end comparator_4bit;
architecture comparator_4bit_arc of comparator_4bit is
begin
comparator : process (a,b) is
begin
if (a=b) then
equal <= '1';
greater <= '0';
lower <= '0';
elsif (a<b) then
equal <= '0';
greater <= '0';
lower <= '1';
else
equal <= '0';
greater <= '1';
lower <= '0';
end if;
end process comparator;
end comparator_4bit_arc;
how do you create a program for a 8 bit comparator using full adders?
ReplyDeletei want the program of reversible quantum comparator sir
ReplyDeleteWhy don't you search on google you'll find the same codes there :D
ReplyDeletehii m bajaj
ReplyDeletend ur nigga
ReplyDelete