Register: An Overview
A register in digital design is a fast storage sequential circuit that can hold data temporarily. A widely used register is D Flip-FLop. A D Flip-Flop is an edge-triggered circuit that combines a pair of latches to store one bit.
Advantages of Registers
- Registers provide fast access to data compared to main memory.
- Ideal for temporary storage during data processing.
Desgin: D Flip-Flop
A D Flip-Flop is an edge-trigger register, either positive edge-triggered, negative edge-triggered, or dual edge-triggered. For the purpose of discussion let’s consider a positive edge-triggered :flip-flop.
The truth table of a positive edge-triggered D Flip-Flop is shown below:
Clk | D | Q | Description |
---|---|---|---|
0 | X | Q | No Change |
0->1 | 0 | 0 | Q to 0 |
0->1 | 1 | 1 | Q to 1 |
1 | X | Q | No Change |
Verilog Code: D Flip-Flop
always_ff@(posedge clk)
if(rst)
q <= 1'b0;
else
q <= d;