Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Implementation of a circuit from truth table in Xilinx

Status
Not open for further replies.

miracle123

Newbie level 4
Joined
Nov 28, 2010
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,313
Can I implement a circuit from truth table in Xilinx ? If so, how ?
 

Yeah. It's just combinational logic. You just need to solve the truth table and get function (in disjunctive or cojunctive form) and write some code.
 

or infer a ROM. eg
constant my_func : std_logic_vector(7 downto 0) := "01101001";
defines a 3b function when my_func is indexed by c,b,a.
my_func(to_integer(unsigned(c&b&a)));
 

You can write the following that behaves like a black box with input and output

Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity truth_table is
  port (  input  :in std_logic_vector(2 downto 0);
          output  :out std_logic_vector(2 downto 0)
	    );
		  
end truth_table;

architecture Structural of truth_table is
  
begin
 
output <= 	"000" when input="001" 
	else	"011" when input="010"
 	else	"111" when input="100";
	
end Structural;

You can change the bit lengths according or your needs, or you can have multiple inputs or outputs.
This VHDL code can be compiled in xilinx or altera etc.

Alex
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top