



















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Lab; Class: SNSR/PERPH INT DSGN; Subject: Electrical Computer Engineering; University: University of California - Santa Barbara; Term: Winter 2009;
Typology: Lab Reports
1 / 27
This page cannot be seen from the preview
Don't miss anything!




















(0 vs. 1)
^ made from components
, e.g.
^
gates, FF’s, muxes, decoders, counters ^ components interconnected by wires^
transform inputs
into outputs
b^ are inputs ^ sum
,^ carry
are outputs
^ xor
,^ and
are components ^ with internal functions that transform their inputs to their outputs interconnecting everything are wires
Half-Adder re-written using std_ulogic entity
half_adder
is
port^
(^ a,^
b^ :^ in
std_ulogic; sum,^
carry
:^ out
std_ulogic
);
end^ half_adder; ^ VHDL is case insensitive for keywords and identifiers ^ Inputs and outputs are referred to as ports ^ Ports are special programming objects & also they are signals ^ Each must be declared to be a certain type, in this case “std_ulogic” (a 9-valued signal type)^
Another possibility is bit_vector – a 1-dimensional array or vector of bits
Entities and Architectures entity
mux is port^ (^ I0,
I1, I2, I^ :^ in std_ulogic_vector
(^ downto
0);
sel^ :^ in std_ulogic_vector (1 downto
0);
Z^ : out
std_ulogic_vector
(^ downto
0)^ );
end^
mux; architecture
behav of
mux is
-- place declarations here (note that -- introduces a line comment)begin -- description of behavior hereend^
behav;
Concurrent signal assignments -- CSAs architecture
concur_behav of
half_adder is
begin sum <= (a xor
b) after
5 ns
carry <= (a and
b) after
5 ns
end^
concur_behav;
A 4-to-1 multiplexer … when/else entity
mux is port^ (^ A,
B,^ C,^ D :
in^ std_ulogic;
sel^ :^ in std_ulogic_vector (1 downto 0); Y^ : out
std_ulogic);
end^
mux; architecture
m1 of
mux is
begin^ Y <= A when
(sel = "00") else B when
(sel = "01") else C when
(sel = "10") else D when
(sel = "11");
end^
m1;
Process statement architecture
arch_name of
entity_name is
begin^ process_name: process
( sensitivity list ) local declaration(s);
begin sequential stmt;sequential stmt;
end^
process
end^
circuits are described
Concurrent vs. Sequential Execution Concurrent
(between begin/end in architecture) ^ everything happens “at once” ^ no significance to statement order
Sequential (between begin/end in a process
^ statements happen in strict sequence
Constant count_limit : integer
^ Constant msg : string
:= “This is a string”;
^ Constant myaddr : bit_vector
(15 downto
‘A’, ‘$’, ‘g’
“testing, 1-2-3” ,
“This is a string of characters --- i.e. a string literal”
---- 8-bit binary literal
300 ns, 900 ps, 40 ma,
16 v
-- always a numeric part and a unit specification