Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LIBRARY ieee;
- USE ieee.std_logic_1164.all;
- ENTITY komparator IS
- PORT
- (
- c: in std_logic_vector(3 downto 0);
- hex0,hex1: out std_logic_vector(6 downto 0)
- );
- END komparator;
- ARCHITECTURE liczby OF komparator IS
- BEGIN
- with c select
- hex0 <=
- "1000000" when "0000", -- 0
- "1111000" when "0001", --1
- "0100100" when "0010", -- 2
- "0110000" when "0011", -- 3
- "0011001" when "0100", -- 4
- "0010010" when "0101", -- 5
- "0000010" when "0110", -- 6
- "1111000" when "0111", -- 7
- "0000000" when "1000", -- 8
- "0010000" when "1001", -- 9
- "1000000" when "1010", -- 10
- "1111000" when "1011", -- 11
- "0100100" when "1100", -- 12
- "0110000" when "1101", -- 13
- "0011001" when "1110", -- 14
- "0010010" when "1111", -- 15
- "1111111" when others;
- with c select
- hex1 <=
- "1111000" when "1010", --10
- "1111000" when "1011",-- 11
- "1111000" when "1100", --12
- "1111000" when "1101", --13
- "1111000" when "1110", --14
- "1111000" when "1111", --15
- "1000000" when others;
- END liczby;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement