1. 문제
- 입력 signal a, b 에 대해서 a가 b보다 클 때, signal agtb가 ‘1’이 되고 a가 b보다 작을 때는 출력 signal altb가 ‘1’이되는 하드웨어를 자료흐름적 표현방법으로 설계하시오.(단, a와 b의 vector 크기는 각각3 downto 0로 선언한다.)
2. 문제 분석
- 자료흐름적 표현방법 : 부울대수식, RTL 혹은 연산자를 사용하여 입력과 출력사이의 관계를 나타내는 것을 말한다. 주로 병행처리문에서 사용되며, 문장의 순서와 무관하게 동시에 수행된다.
ex) y <= a and b;
y <= a or b;
3. VHDL code
library ieee;
use ieee.std_logic_1164.all;
entity exam1 is
port(a, b : in std_logic_vector(3 downto 0);
agtb, altb : out std_logic);
end exam1;
architecture exam of exam1 is
begin
altb <= ((not(a(3) xor b(3))) and (not(a(2))and b(2))) or
((not(a(3) xor b(3))) and (not(a(2) xor b(2))) and
( not(a(1))and b(1))) or ((not(a(3) xor b(3))) and
( not(a(2) xor b(2))) and (not(a(1) xor b(1))) and
( not(a(0)) and b(0))) or (not(a(3)) and b(3));
agtb <=(((not(a(3) xor b(3))) and (not(a(2))and b(2))) or
((not(a(3) xor b(3))) and (not(a(2) xor b(2)) )and
( not(a(1))and b(1))) or ((not(a(3) xor b(3))) and
( not(a(2) xor b(2))) and (not(a(1) xor b(1))) and
( not(a(0)) and b(0)))or ( not(a(3)) and b(3))) nor
((not(a(3) xor b(3))) and (not(a(2) xor b(2))) and
( not(a(1) xor b(1))) and (not(a(0) xor b(0))));
end exam;
4. Simulation
5. 결론
-결론
범위 |
관계식 |
결과값 |
0ns ~ 100ns |
a < b |
altb = 1 , agtb = 0 |
100ns ~ 200ns |
a > b |
altb = 0 , agtb = 1 |
200ns ~ 300ns |
a < b |
altb = 1 , agtb = 0 |
300ns ~ 400ns |
a > b |
altb = 0 , agtb = 1 |
400ns ~ 500ns |
a < b |
altb = 1 , agtb = 0 |
500ns ~ 600ns |
a > b |
altb = 0 , agtb = 1 |
600ns ~ 700ns |
a < b |
altb = 1 , agtb = 0 |
700ns ~ 800ns |
a > b |
altb = 0 , agtb = 1 |
감산기 VHDL (0) | 2008.10.08 |
---|---|
Masking (Constant) (0) | 2008.10.08 |
Variable을 이용한 전가산기의 구현 VHDL (0) | 2008.10.08 |
Signal을 이용한 전가산기의 구현 VHDL (0) | 2008.10.08 |
입력 Signal 비교기 VHDL (Process) (0) | 2008.10.08 |
S | M | T | W | T | F | S |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |