VHDL
来源:互联网 发布:java子类加载顺序 编辑:程序博客网 时间:2024/04/28 20:46
带请零端的8位并行输入串行输出移位寄存器(74166)
管脚定义:
a,b—h 8位并行输入信号
se 串行输入信号
q 串行输出信号
clk 时钟信号
fe 时钟信号禁止端
s1 移位装载控制端
reset 复位信号
LIBRARY ieee;
use ieee.std_logic_1164.all;
entity ttl74166 is
port(reset,s1,fe,clk,se,a,b,c,d,e,f,g,h: in std_logic;
39
q: out std_logic);
end ttl74166;
architecture behave of ttl74166 is
signal tmpreg8: std_logic_vector(7 downto 0);
begin
process(clk,reset,s1,fe)
begin
if (reset='0') then --
tmpreg8<="00000000";
q<=tmpreg8(7);
elsif clk'event and clk='1' then
if (fe='0') then
if (s1='0') then
tmpreg8(0)<=a;
tmpreg8(1)<=b;
tmpreg8(2)<=c;
tmpreg8(3)<=d;
tmpreg8(4)<=e;
tmpreg8(5)<=f;
tmpreg8(6)<=g;
tmpreg8(7)<=h;
elsif (s1='1') then
for i in tmpreg8'high downto tmpreg8'low+1 loop
tmpreg8(i)<=tmpreg8(i-1);
end loop;
tmpreg8(tmpreg8'low)<=se;
q<=tmpreg8(7);
end if;
end if;
end if;
end process;
end behave;
管脚定义:
a,b—h 8位并行输入信号
se 串行输入信号
q 串行输出信号
clk 时钟信号
fe 时钟信号禁止端
s1 移位装载控制端
reset 复位信号
LIBRARY ieee;
use ieee.std_logic_1164.all;
entity ttl74166 is
port(reset,s1,fe,clk,se,a,b,c,d,e,f,g,h: in std_logic;
39
q: out std_logic);
end ttl74166;
architecture behave of ttl74166 is
signal tmpreg8: std_logic_vector(7 downto 0);
begin
process(clk,reset,s1,fe)
begin
if (reset='0') then --
tmpreg8<="00000000";
q<=tmpreg8(7);
elsif clk'event and clk='1' then
if (fe='0') then
if (s1='0') then
tmpreg8(0)<=a;
tmpreg8(1)<=b;
tmpreg8(2)<=c;
tmpreg8(3)<=d;
tmpreg8(4)<=e;
tmpreg8(5)<=f;
tmpreg8(6)<=g;
tmpreg8(7)<=h;
elsif (s1='1') then
for i in tmpreg8'high downto tmpreg8'low+1 loop
tmpreg8(i)<=tmpreg8(i-1);
end loop;
tmpreg8(tmpreg8'low)<=se;
q<=tmpreg8(7);
end if;
end if;
end if;
end process;
end behave;
- VHDL
- VHDL
- VHDL
- VHDL
- VHDL
- VHDL
- 有关VHDL
- 什么是VHDL?
- VHDL进程
- VHDL注意事项
- vhdl 学习心得
- VHDL 时钟
- VHDL笔记
- VHDL学习
- vhdl笔记--
- VHDL TEXTIO
- VHDL TEXTIO
- VHDL基础
- 内部类的使用
- 堆和栈的区别
- 子父页面刷新关闭
- 我们从Dennis Ritchie身上学到了什么
- linux VFS数据结构(二)
- VHDL
- xs128 定时器溢出中断
- SendMessage函数完全使用手册(C#)
- java字节流,字符流问题怎么判断一个文件要用字节流还是用字符流
- 程序分text, data (initialized), bss, stack, heap几个段
- Android应用程序键盘(Keyboard)消息处理机制分析
- xs128 D-Flash读写
- 如何使用SQL Server INSTEAD-OF触发器
- 回溯算法