Bonjour,
Je veux réaliser un registre à décalage à droite qui reçoit à les données en série sur une entrée std_logic et qui fait le décalage à droite sur une sortie 32 bits.
J'ai déjà codé et simulé mais j'aimerais qu'il complète les bit moins sensible par '0'.
Cependant, il fait le contraire.
J'aurais besoin de votre aide SVP!!!
Vous trouverez ci-joint une capture de la simulation.
Le code est le suivant:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 library ieee; use ieee.std_logic_1164.all; entity RDecalage is port(SD , e , R ,H : in std_logic; Q: out std_logic_vector(31 downto 0):= (others=>'0') ); end RDecalage; architecture ArchiRD of RDecalage is signal buf: std_logic_vector(31 downto 0):=(others=>'0'); begin process(H, e, R) begin if(H'event and H='1' ) then if(R='1') then buf <= (others=>'0'); else if(e='0')then buf<= buf; else buf(0)<=SD; buf(31 downto 1)<= buf(30 downto 0) ; end if; end if; end if; end process; Q<=buf; end ArchiRD;
Partager