This lecture delves into the fundamental concepts of basic sequential circuits using Verilog, covering latches, flip-flops, registers, counters, shift registers, datapaths, and state machines. We explore the R-S Latch operation, detailing both active HIGH and active LOW configurations. The lecture emphasizes Verilog coding techniques for implementing these circuits, including example modules for D flip-flops, counters, and shift registers. By understanding these basic building blocks, students can design and simulate more complex digital systems effectively.
01 / 65Exploring Basic Sequential Circuits in Verilog: Latches, Flip-Flops, Registers, and More
1 / 17
Télécharger la présentation
Exploring Basic Sequential Circuits in Verilog: Latches, Flip-Flops, Registers, and More
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
R-S Latch R Q S R-S Latch Q is set to 1 when S is asserted, and remains unchanged when S is disasserted. Q is reset to 0 when R is asserted, and remains unchanged when R is disasserted. Assertions can be active HIGH or active LOW
R-S Latch R Q S module RSlatch ( Q ,R ,S ); input R ; wire R ; input S ; wire S ; output Q ; reg Q ; always @(R or S) begin if(S == 1 && R == 0) Q = 1; elseif(S == 0 && R == 1) Q = 0; end endmodule Active HIGH
R-S Latch R Q S module RSlatch ( Q ,R ,S ); input R ; wire R ; input S ; wire S ; output Q ; reg Q ; always @(R or S) begin if(S == 0 && R == 1) Q = 1; elseif(S == 1 && R == 0) Q = 0; end endmodule Active LOW
Note that this is different from the "textbook" RS latch module RSlatchNOR ( Q ,R ,S ); input R ; wire R ; input S ; wire S ; output Q ; wire Q ; wire F1, F2; nor #10 (F1,F2,R); nor #10 (F2,F1,S); assign Q = F1; endmodule 10ns propagation delay
R S Q 0 0 Q0 store 0 1 1 set 1 0 0 reset 1 1 0 disallowed
R-S Latch R Q S How can you make this R-S latch from gates? Q is set to 1 when S is asserted, and remains unchanged when S is disasserted. Q is reset to 0 when R is asserted, and remains unchanged when R is disasserted. Assertions can be active HIGH or active LOW
SQ R-S Latch 00 01 11 10 R R Q 0 S 1 Q is set to 1 when S is asserted (1), and remains unchanged when S is disasserted (0). Q is reset to 0 when R is asserted (1), and remains unchanged when R is disasserted (0). R S Q Q 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 store 1 1 1 set 1 reset store Q = ~R & Q | ~R & S | S & Q
R-S Latch R Q S RS Latch R S Q Q 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 store set reset store Q = ~R & Q | ~R & S | S & Q
module RSlatchGates ( Q ,R ,S ); input R ; wire R ; input S ; wire S ; output Q ; wire Q ; assign #10 Q = ~R & Q | ~R & S | S & Q; endmodule
D Latch D Q EN D Latch Q follows D when EN is high, and remains unchanged when EN is low..
D Latch D Q EN module Dlatch ( Q ,EN ,D ); input EN ; wire EN ; input D ; wire D ; output Q ; reg Q ; always @(D or EN) if(EN == 1) Q = D; endmodule
Q D clk !Q D clk Q !Q 0 0 1 1 1 0 X 0 Q0 !Q0 D Flip-Flop Positive edge triggered D gets latched to Q on the rising edge of the clock. Behavior always @(posedge clk) Q <= D;