aboutsummaryrefslogtreecommitdiff
path: root/adder-and-display/adder-and-display.srcs/sources_1/main.vhd
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-11-10 17:10:23 +0100
committerlonkaars <loek@pipeframe.xyz>2022-11-10 17:10:23 +0100
commit97ea7b4d15504f6826d8ccec7383a5c4f7ea47d0 (patch)
tree5b8202625a53171f499b3b29c6c74340e4314ede /adder-and-display/adder-and-display.srcs/sources_1/main.vhd
parent9ceab8dbefe658b9938b0ed12b50492304fcce3a (diff)
WIP week 2
Diffstat (limited to 'adder-and-display/adder-and-display.srcs/sources_1/main.vhd')
-rw-r--r--adder-and-display/adder-and-display.srcs/sources_1/main.vhd36
1 files changed, 36 insertions, 0 deletions
diff --git a/adder-and-display/adder-and-display.srcs/sources_1/main.vhd b/adder-and-display/adder-and-display.srcs/sources_1/main.vhd
new file mode 100644
index 0000000..448d0a7
--- /dev/null
+++ b/adder-and-display/adder-and-display.srcs/sources_1/main.vhd
@@ -0,0 +1,36 @@
+library IEEE;
+use IEEE.STD_LOGIC_1164.ALL;
+
+entity main is
+ port (
+ A: in std_logic_vector(3 downto 0);
+ B: in std_logic_vector(3 downto 0);
+ Cin: in std_logic;
+ D1: out std_logic_vector(6 downto 0);
+ D2: out std_logic_vector(6 downto 0);
+ Cout: out std_logic);
+end main;
+
+architecture Behavioral of main is
+signal RESULT: std_logic_vector(3 downto 0);
+signal BCD1: std_logic_vector(3 downto 0);
+signal BCD2: std_logic_vector(3 downto 0);
+begin
+ add: entity work.add4b port map (
+ A => A,
+ B => B,
+ Cin => Cin,
+ X => RESULT,
+ Cout => Cout);
+ bcdconv: entity work.bin2bcd port map (
+ A => RESULT,
+ X => BCD1,
+ Y => BCD2);
+ bcddec1: entity work.bcddec port map (
+ A => BCD1,
+ X => D1);
+ bcddec2: entity work.bcddec port map (
+ A => BCD2,
+ X => D2);
+end Behavioral;
+