Professional Documents
Culture Documents
DIGITAL IC DESIGN
USING HDL
CHAPTER 5:
SEQUENTIAL SIGNAL
ASSIGNMENT OF VHDL
1 • Introduction
4 • Conceptual implementation
process (a, b)
begin complete
if (a = b) then eq <= '1'; branch
else eq <= '0';
end if;
end process;
NGUYEN THANH NGHIA 33
Chapter 5: Sequential signal assignment of VHDL
4. If statement
INCOMPLETE BRANCH AND INCOMPLETE SIGNAL ASSIGNMENT
process (a, b)
begin Incomplete
if (a > b) then gt <= '1'; signal
elsif (a = b) then eq <= '1'; assignment
else lt <= '1';
end if;
end process; complete
signal
process (a, b)
assignment
begin
if (a > b) then gt <= '1'; eq <= '0'; lt <= '0';
elsif (a = b) then gt <= '0'; eq <= '1'; lt <= '0';
else gt <= '0'; eq <= '0'; lt <= '1';
end if;
end process;
NGUYEN THANH NGHIA 34
Chapter 5: Sequential signal assignment of VHDL
4. If statement
INCOMPLETE BRANCH AND INCOMPLETE SIGNAL ASSIGNMENT
process (a, b)
begin
if (a > b) then gt <= '1'; eq <= '0'; lt <= '0';
elsif (a = b) then gt <= '0'; eq <= '1'; lt <= '0';
else gt <= '0'; eq <= '0'; lt <= '1';
end if;
end process;
One way to make the code compact and clear is to assign a
default value for each signal in the beginning of the process:
process (a, b)
begin
gt <= '0'; eq <= '0'; lt <= '0';
if (a>b) then gt <= '1';
elsif (a=b) then eq <= '1';
else lt <= '1';
end if;
end process;
NGUYEN THANH NGHIA 35
Chapter 5: Sequential signal assignment of VHDL
4. If statement
CONCEPTUAL IMPLEMENTATION
4 • Conceptual implementation
1 • Syntax
2 • Examples
3 • Conceptual implementation
The end!