ZKX's LAB

vhdl实现串 并转换

2020-07-19知识7

哪位大神能用vhdl语言实现16位2进制数转换成10进制数啊 就是输出一个10进制整数。.真是怎么弄不对啊 谢谢 这个程序是我在你的一个提问中回答的,这就是一个2输入与非门的VHDL程序啊,如果不是你要求的,你把SN7401 四2输入端与非门(OC)要实现的功能发上来vhdl实现补码到原码的转换? 已知补码求源码 其实就是对补码求补先取反 再加1求补码 说明你做的是负数的求补 所以第一位应该是符号位vhdl代码如下LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_ARITH.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;ENTITY exp ISPORT(clk:in std_logic;a:in std_logic_vector(7 downto 0);b:out std_logic_vector(7 downto 0));END exp;ARCHITECTURE one OF exp ISBEGINPROCESS(clk)VARIABLE temp:std_logic_vector(7 downto 0);beginif clk'event and clk='1' thentemp:=a XOR\"01111111;异或求反temp:=conv_std_logic_vector(conv_integer(temp)+1,8);temp转换成整数加1后再转换回来b;结果输出end if;end process;end one;用vhdl语言实现8位并转串电路和串转并电路,求大神指导!!急用!! library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity sc isport(clk,rxd:in std_logic;data:out std_logic_vector(7 downto 0));end sc;architecture rt8251 of sc issignal count:std_logic_vector(3 downto 0):=\"0000;signal do_latch:std_logic_vector(7 downto 0);signal d_fb:std_logic_vector(9 downto 0);signal rxdf:std_logic;signal rdfull:std_logic:='0';begindata;P1:process(clk)beginif(clk'event and clk='1')thenif((rxdf='1')and(count=\"1000\"))thendo_latch(7 downto 0)(7 downto 0);rdfull;end if;end if;end process p1;p2:process(clk)beginif(clk'event and clk='1')thenif(rxd='0')thenrxdf;elsif((rxdf='1')and(count=\"1000\"))thenrxdf;end if;end if;end process p2;p3:process(clk)variable scir:integer range 0 to 8;variable scis:std_logic_vector(3 downto 0);beginif(clk'event and clk='1')thenif(rxdf='1')thenscir:=scir+1;elsescir:=0;end if;end if;scis:=conv_std_logic_vector(scir,4);count;end process p3;p4:process(clk)begincase count iswhen。用VHDL实现十进制到二进制的转换 library ieee;此程序是个人所编,还未经验证use ieee.std_logic_1164.all;use ieee.std_logic_unsigned;use ieee.std_logic_arith;entity ss isport(st:in std_logic;shuru:in integer range 0 to 255;shuchu:out std_logic_vector(7 downto 0));end ss;architecture b of ss isbeginprocess(st)variable c:integer range 0 to 255;variable d:integer range 0 to 255;variable a:integer range 0 to 7;beginif st'event and st='1' then-st为转换启动信号,上升沿启动shuchu;对输出初始化c:=shuru;保存输入d:=shuru;保存输入a:=0;while c/0 loop-c不等于零则循环,c等于零则退出循环c:=c/2;循环除2,类似于十进制数转化为二进制数的方法d:=d-(c*2);算完后,d为计算出的每位二进制数shuchu(a);把每为二进制数安位给输出d:=c;作为下次除2的被除数a:=a+1;end loop;end if;st;控制信号清零,等待下一次转换的到来end process;end b;如何用vhdl实现按一下按键,转换一种状态,松开后状态保持不变,再按一次,回复本来状态? 简单,你可用一个信号作桥梁;al='0' then al;case al iswhen ':al std_logic;process(al;tehn alif a='0';前面省略一点…signal;o',a)beginif rst='=';when others=>;null;0',给你举个例子,假设按A输出y为1 松了还是1;y求助!!!!VHDL 如何用按键来转换数码管的显示 你可以把4对分成两组,当按键按一下,就换一组显示,或者两个按键控制,按下哪个按键就显示哪个,给你一个特例程序分别是以上两种方法 的,你可以参考参考,port(input1,input2:in std_logic_vector(7 downto 0);两组数据key:in std_logic;按键(应该是消抖后的)output:out std_logic);end entity;architecture art of.isbeginprocess(input1,input2,key)variable cnt:std_logic;beginif key'event and key='1' then-假设按键是高电平有效;cnt:=not cnt;if cnt='0' thenoutput;else output;end if;end if;用VHDL实现十六进制转换为10进制 本来不想用时钟的,可是不用编译非常慢,可能太复杂吧,就用了一下,不太会,就将就着用用吧,library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity conv isport(clk:in std_logic;in16:in std_logic_vector(15 downto 0);out1,out2,out3,out4:out std_logic_vector(3 downto 0));end entity conv;architecture bhv of conv isbeginprocess(clk,in16)variable tmp,q1,q2,q3:integer;begintmp:=conv_integer(in16);q1:=tmp/10;q2:=q1/10;q3:=q2/10;if clk'event and clk='1' thenout1(tmp rem 10,4);out2(q1 rem 10,4);out3(q2 rem 10,4);out4(q3 rem 10,4);end if;end process;end bhv;基于vhdl的串并转换器 首先,用变量时最好初始化一下variable t:std_logic_vector(2 downto 0):=\"000;要不一开始输出是个不确定值。还有就是这段写得不规范,改一下if clk'event and clk='1' thenif i=3 thenDout3(2);Dout2(1);Dout1(0);i:=0;elset(2 downto 0):=t(1 downto 0)&din;i:=i+1;end if;end if;VHDL怎么实现并串转换啊?我这有程序看不懂,高手给详细解释下,谢谢 主要就是“shiftreg(15 downto 1)(14 downto 0)”这句话的,其他来是控制信号的。用count 来控制16位数据一次输出自的。并串转换,你zhidao的程序是16位化为16个串行的时钟输出out(15);

随机阅读

qrcode
访问手机版