Last active
August 29, 2015 14:21
-
-
Save alvadorn/f3b6025b343ef5129f0e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library IEEE; | |
use IEEE.STD_LOGIC_1164.all; | |
ENTITY somador4 IS | |
PORT ( A, B: IN STD_LOGIC_VECTOR (3 DOWNTO 0); | |
SUM: OUT STD_LOGIC_VECTOR (3 DOWNTO 0); | |
CARRY: OUT STD_LOGIC | |
); | |
END somador4; | |
ARCHITECTURE soma OF somador4 IS | |
SIGNAL AUXILIAR: STD_LOGIC_VECTOR (4 DOWNTO 0); | |
BEGIN | |
AUXILIAR <= ('0' & A) + ('0' & B); | |
SUM <= AUXILIAR(3 DOWNTO 0); | |
CARRY <= AUXILIAR(4); | |
END soma; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment