Вы находитесь на странице: 1из 4

ESCUELA COLOMBIANA DE INGENIERA

SISTEMAS ELECTRNICOS DIGITALES 2


EXAMEN PRIMER TERCIO
SEPTIEMBRE 19 DE 2013
NOMBRE _________________________________________ NOTA _______

1. (30%) Analice el siguiente Cdigo:


a. determine que funcin realiza.
b. Implemente el cdigo diferente
P01.vhd
------------------------------------------------------------------library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity P01 is
Port ( D : in STD_LOGIC_VECTOR (5 downto 0);
O : out STD_LOGIC_VECTOR (7 downto 0));
end P01;
architecture Behavioral of P01 is
component Cto
Port ( I : in STD_LOGIC_VECTOR (3 downto 0);
Z : out STD_LOGIC_VECTOR (3 downto 0));
end component;
--signal sA, sB, sC : STD_LOGIC_VECTOR (3 downto 0);
signal sA, sB : STD_LOGIC_VECTOR (3 downto 0);
begin
Cto01:Cto
--Port map(I(3)=>'0',I(2)=>D(5),I(1)=>D(4),I(0)=>D(3),Z=> sA);
Port map(I(3)=>'0', I(2 downto 0)=>D(5 downto 3), Z=> sA);
Cto02:Cto
--Port map(I(3)=>sA(2),I(2)=>sA(1),I(1)=>sA(0),I(0)=>D(2),Z=> sB);
Port map(I(3 downto 1)=>sA(2 downto 0), I(0)=>D(2), Z=> sB);
Cto03:Cto
--Port map(I(3)=>sB(2),I(2)=>sB(1),I(1)=>sB(0),I(0)=>D(1),Z=> sC);
Port map(I(3 downto 1)=>sB(2 downto 0),I(0)=>D(1),Z=>O(4downto1));
O(7)
O(6)
O(5)
O(0)

<=
<=
<=
<=

'0';
sA(3);
sB(3);
D(0);

end Behavioral;

Cto.vhd
------------------------------------------------------------------entity Cto is
Port ( I : in STD_LOGIC_VECTOR (3 downto 0);
Z : out STD_LOGIC_VECTOR (3 downto 0));
end Cto;
architecture Behavioral of Cto is
begin
With I Select
Z <= "0000" when
"0001" when
"0010" when
"0011" when
"0100" when
"1000" when
"1001" when
"1010" when
"1011" when
"1100" when
"0000" when
end Behavioral;

"0000",
"0001",
"0010",
"0011",
"0100",
"0101",
"0110",
"0111",
"1000",
"1001",
others;

S2 = 0

S2 = 1

2. (40%) Disee una ALU para palabras de 4bits que realice las siguientes funciones
indicadas en la tabla con las siguientes caractersticas:
Realice en diseo con sumadores completos.
a. Con un circuito para B que dependa slo de S1 y S0 (sin S2), mostrando su funcin
b. Con un circuito para A, mostrando su funcin.
c. Muestre cmo sera la conexin total del diseo.
d. Implemente con cdigo Vhdl pensado en su circuito.
Las dos primeras instrucciones aritmticas son de incremento A + 1 (no es A+F).
S1
0
0
1
1

S0
0
1
0
1

Aritmticas
A+1
B+1
A+B
A-B

S1
0
0
1
1

S0
0
1
0
1

Lgicas
not(A)
not(B)
A or B
A and B

3. (30%) Realice los siguientes ejercicios:


a. Implemente la siguiente funcin con LUTs de 3 entredas.
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

W X Y Z
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1

F
1
0
1
0
0
1
0
1
1
1
0
0
0
0
1
1

b. Implemente con mux de 2 entradas, usando nicamente negadores las siguientes


funciones lgicas: XOR, NAND, NOR.
c. describa qu funcin realiza el siguiente cdigo:
...
signal a, b, Y : std_logic;
begin
Y <= '0' when a = b else
'1';
...
d. describa qu funcin realiza el siguiente cdigo:
...
signal a, b, Y : std_logic;
begin
Y <= '0' when
b when
a when
a and b
...

"00",
"01",
"10",
when others;

(El punto opcional sirve para remplazar el punto 1 3)


Opc. (30%) Realice un diseo que decodifique dos nmeros en ASCII, debe
- Garantizar que sean nmeros
- Determinar si el nmero se encuentra entre 01 y 20. Si es as activar una salida.

Ayudas
Condicionales
------------------------------------------------------------------s_name <= value1 when boolean-expr1 else
value2 when boolean-expr2 else
value3 when boolean-expr3 else
...
value_n;
------------------------------------------------------------------with selector select
signal-name <= value-1
value-2
value-3
...
value-n

when choice-1 ,
when choice-2,
when choice-3,
when choice-n;

------------------------------------------------------------------process(sensitivity-list)
begin
if boolean-expr-1 then
s-statements;
elsif boolean-expr-2 then
s-statements ;
elsif boolean-expr-3 then
s-statements;
...
else
sequential
end if;
end process;
------------------------------------------------------------------process(sensitivity-list)
begin
case case-expression is
when choice-1 =>
sequential statements;
when choice-2 =>
sequential statements;
...
when choice-n =>
sequential statements;
end case;
end process;
-------------------------------------------------------------------

Вам также может понравиться