05.07.2013 Views

Xilinx Synthesis Technology User Guide

Xilinx Synthesis Technology User Guide

Xilinx Synthesis Technology User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

VHDL Code<br />

HDL Coding Techniques<br />

Following is the VHDL code for a 4-bit unsigned up accumulator<br />

with asynchronous clear.<br />

library ieee;<br />

use ieee.std_logic_1164.all;<br />

use ieee.std_logic_unsigned.all;<br />

entity accum is<br />

port(C, CLR : in std_logic;<br />

D : in std_logic_vector(3 downto 0);<br />

Q : out std_logic_vector(3 downto 0));<br />

end accum;<br />

architecture archi of accum is<br />

signal tmp: std_logic_vector(3 downto 0);<br />

begin<br />

process (C, CLR)<br />

begin<br />

if (CLR='1') then<br />

tmp

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!