Professional Documents
Culture Documents
Madhav Desai
January 9, 2015
In a combinational circuit, the stable values of the outputs depend solely on the
stable values the current inputs. Thus the response of a combinational circuit to
an input event is always the same (irrespective of what happened in the past).
To describe a combinational circuit in VHDL, one has several options. We
illustrate this with an example. Suppose we want to describe a combinational
circuit which has one output bit w and inputs a,b,c,d,e (all bits), and implements
the formula
w = (a + b + c).(d + e)
Such a circuit can be described in several ways, of which the following are the
most common.
The first is to use concurrent assignments. For example
w <= (a or b or c) and (not (d or e));
or
w <= u and v;
u <= (a or b or c);
v <= not ( d or e);
etc. In this case, it is easy to verify that each driver is purely combinational
because the output of each driver depends only on the inputs (and the inputs do
not include the output!). Further, the network of drivers is acyclic, and hence
can have no state.
The second way is to use a process statement.
process(a,b,c,d,e)
variable u, v: bit;
begin
u := (a or b or c);
u := (u and not(d or e));
w <= u;
end process;
In this case, it is clear that every time the process statement is executed, the
value scheduled to be written onto w is a function entirely of a,b,c,d,e and does
not depend on the old value of w.
1.1
In Lab Assignment
Home Assignment
Read up on array types and implement the PriorityEncoder with the following
entity description
entity PriorityEncoder is
port (x: in bit_vector(7 downto 0);
s: out bit_vector(2 downto 0);
N: out bit);
end entity PriorityEncoder;
The behaviour of the encoder is the same as before.
Implement an architecture for the PriorityEncoder entity. Verify it using
a testbench which checks all 256 input conditions. The test-bench should be
self checking; ie, it should report success/failure without you having to check
waveforms.