
vhdl学习
durant
这个作者很懒,什么都没留下…
展开
-
vhdl学习——最简单分频器
library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity divide is port( clk :in std_logic; en :in std_logic; clk_out :out std_logic );end entity;architecture rtl of divide issignal tmp :std_lo原创 2010-12-23 21:07:00 · 1097 阅读 · 0 评论 -
VHDL学习——10位2进制全加器
采用行为描述library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity adder is port( a,b :in std_Logic_vector(9 downto 0); co :in std_logic_vector(9 downto 0); c1 :out std_logic; sum :out std_logic_vector(10 d原创 2010-12-26 13:01:00 · 1074 阅读 · 0 评论 -
VHDL——并转串程序(74LS165)
http://b57.photo.store.qq.com/http_imgload.cgi?/rurl4_b=a4f672579e9872ef3f2d39c840e6a6b401c2d2dc2c8be5bbfc517cef5bab8a12ed18133429ce3bc3cf32e09746121a3f542ca085e470d4ba0d0fde6185f1d114d54d4c74bcc93bf62c65f8deea8f1c3e992ef8aa&a=66&b=57本来以为很好写,但写的时候发现有点问题。sl原创 2010-12-30 22:20:00 · 2312 阅读 · 0 评论 -
VHDL——子程序调用,实现数据交换
前面写过一个74ls165并转串的程序,但实际用了2块165级联成16位的并转串,为了布线是的方便,就把并行输入的数据打乱了,现在要调整回去,可以借鉴下面的程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity swap is port ( data :in std_logic_vector(7 downto 0); q :out std_logic_vec原创 2011-01-05 19:34:00 · 1675 阅读 · 0 评论 -
VHDL——摩尔型状态机
看公司的vhdl代码大部分都是用状态机来完成的,看的很有条理,一个状态一个状态的来,工作过程看的一清二楚我写的很简单,也很丑陋,慢慢进步了library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity test is port( sw :in std_logic_vector(3 downto 0); clk,reset :in std_logic; led原创 2011-02-28 21:02:00 · 1599 阅读 · 0 评论 -
VHDL——如何写简单的testbench
弄了好长时间vhdl,一直对testbench很迷惑。前几天静下心来好好看了下资料,终于会写简单的testbench了。六进制计数器的代码library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;--use ieee.std_logic_unsigned.all;entity cnt6 is port (clr,en,clk :in std_logic; q :out std_logi原创 2011-03-13 20:46:00 · 13971 阅读 · 10 评论 -
VHDL——简单同步FIFO
<br />功能:存入数据按顺序排放,存储器全满时给出信号并拒绝继续存入,全空时也给出信号并拒绝读出;读出时按先进先出原则;存储数据一旦读出就从存储器中消失<br /> <br />library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_signed.all;entity fifo is port( datain :in std_logic_ve原创 2011-03-17 23:21:00 · 1563 阅读 · 1 评论