Logic Synthesis with VHDL
Combinational Logic


Bob Reese
Electrical Engineering Department
Mississippi State University



Converted to HTML by
MANJUNATH R. MITTHA,
MS Student, Dept. of Electrical Eng.,
Mississippi State University


Index


Logic Synthesis
Tutorial Caveats
VHDL Synthesis Subset
General Comments about VHDL Syntax
Combinational Logic Examples
Model Template
2 to 1 Mux - Using when else..
Standard Logic 1164
2 to 1 Mux Entity Declaration
2 to 1 Mux Architecture Declaration
2 to 1 Mux Architecture using Booleans
2 to 1 Mux Architecture using a Process
8 Level Priority Encoder
3 to 8 Decoder Example
A Common Error
Alternative 3 to 8 Decoder
Generic Decoder
Synthesis Boundary Conditions
Ripple Carry Adder
Ripple Carry Adder Comments
Summary


Logic Synthesis


BACK TO INDEX

Tutorial Caveats


BACK TO INDEX

VHDL Synthesis Subset


BACK TO INDEX

General Comments on VHDL Syntax


BACK TO INDEX

Combinational Logic Examples


BACK TO INDEX

Model Template


entity  model_name is

port 
(
	list of inputs and outputs
);
end  model_name;


architecture architecture_name of model_name is
begin
 	...
   	VHDL concurrent statements
	....

end architecture_name ;
BACK TO INDEX

2-to-1 MUX -- Using when else


BACK TO INDEX


Standard Logic 1164


library IEEE;
use IEEE.std_logic_1164.all;
BACK TO INDEX

2/1 MUX Entity Declaration


entity mux2to1 is
port
(
  signal    s:                in      std_logic;  
  signal    zero,one:   in     std_logic_vector(7 downto 0); 
  signal    y:             out    std_logic_vector(7 downto 0) 
);
end mux2to1;
BACK TO INDEX

2/1 MUX Architecture Declaration


architecture behavior of mux2to1 is
begin  

	y <= one when (s = '1') else zero;

end behavior;

BACK TO INDEX


2/1 MUX Architecture Using Booleans


architecture behavior of mux2to1 is
 signal temp: std_logic_vector(7 downto 0);

begin  
  temp <= (s, s, s, s, others => s);
  y <= (temp and one) or (not temp and zero);

end behavior;
BACK TO INDEX

2/1 MUX Architecture Using a Process


architecture behavior of mux2to1_8 is
begin
 
  comb: process (s, zero, one) 
  begin
     y <= zero;
     if (s = '1') then
       y <= one;
     end if;
 end  process comb;
end behavior;
BACK TO INDEX

8-level Priority Encoder


BACK TO INDEX

3 to 8 Decoder Example


BACK TO INDEX


A Common Error


BACK TO INDEX

Alternative 3 to 8 Decoder


BACK TO INDEX


Generic Decoder


architecture behavior of generic_decoder is
begin
  process (sel, en)
  begin
    y <= (others => '1') ;
    for i in  y'range  loop  
      if ( en = '1' and  bvtoi(To_Bitvector(sel)) = i ) then  
         y(i) <= '0' ;
      end if ;
    end loop;
  end process;
end behavior;
....
   for i in  y'range  loop  
      if ( en = '1' and  bvtoi(To_Bitvector(sel)) = i ) then  
         y(i) <= '0' ;
      end if ;
BACK TO INDEX

Synthesis Boundary Conditions


BACK TO INDEX


Ripple Carry Adder


BACK TO INDEX


Ripple Carry Adder Comments


BACK TO INDEX

Summary


BACK TO INDEX