Last active
August 29, 2015 14:05
-
-
Save davilamds/18ebcc508aba983f3288 to your computer and use it in GitHub Desktop.
Encoder prioridad
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 Priority_encoder is | |
port( | |
r: in std_logic_vector(4 downto 1); | |
pcode: out std_logic_vector(2 downto 0) | |
); | |
end Priority_encoder; | |
architecture cond_arch of Priority_encoder is | |
begin | |
pcode <= "100" when (r(4)='1') else | |
"011" when (r(3)='1') else | |
"010" when (r(2)='1') else | |
"001" when (r(1)='1') else | |
"000"; | |
end cond_arch; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment