Verilog (digital engine)74HC595v_hc595
74HC595 (8-bit shift register, latched outputs)
74HC595: serial in (SER, SRCLK), parallel out QA–QH through a storage register (RCLK) with tri-state outputs (OE̅), cascade output QH'. Functional Verilog model, numbered SOIC-16 pins as in the TI datasheet.
Key data
- Category
- Logic (Verilog)
- Simulation model
- Verilog (digital engine)
- Manufacturer part number
- 74HC595
- Reference prefix
- U
- Pins
- 16
- Land pattern
- SOIC-16_3.9x9.9mm_P1.27mm
Notes
- Arduino: shiftOut(dataPin, clockPin, MSBFIRST, value) on SER and SRCLK, then a pulse on RCLK shows the byte on QA–QH (QH = first bit sent with MSBFIRST).
- Chain several chips: QH' to SER of the next one, SRCLK and RCLK in parallel.
- Tie SRCLR̅ to VCC and OE̅ to GND when you do not need them; each output drives an LED through its own resistor.
Simulation model
The Verilog source is synthesized to gates with Yosys (WebAssembly) and simulated event by event. Outputs drive the analog circuit like CMOS pins through a driver resistance to the supply; inputs switch at 30 % and 70 % of the supply.
- Supply pins
- 16 / 8
- Top module
- v_hc595
- Output driver resistance
- 50 Ω
Verilog source
module v_hc595(input SER,SRCLK,RCLK,nSRCLR,nOE,output QA,QB,QC,QD,QE,QF,QG,QH,QHS);
reg [7:0] sr,st;
always @(posedge SRCLK or negedge nSRCLR) if(!nSRCLR)sr<=8'b0;else sr<={sr[6:0],SER};
always @(posedge RCLK) st<=sr;
assign {QH,QG,QF,QE,QD,QC,QB,QA}=nOE?8'bzzzzzzzz:st;
assign QHS=sr[7];
endmodulePins 16
| Pin | Name | Use |
|---|---|---|
| 1 | QBOutput pin | Parallel output B |
| 2 | QCOutput pin | Parallel output C |
| 3 | QDOutput pin | Parallel output D |
| 4 | QEOutput pin | Parallel output E |
| 5 | QFOutput pin | Parallel output F |
| 6 | QGOutput pin | Parallel output G |
| 7 | QHOutput pin | Parallel output H |
| 8 | GNDGround pin | Ground |
| 9 | QHSOutput pin | Serial out (QH'): to SER of the next 74HC595 for chains |
| 10 | nSRCLRInput pin | Clear the shift register, active low: tie to VCC when unused |
| 11 | SRCLKInput pin | Shift clock: rising edge shifts SER in |
| 12 | RCLKInput pin | Storage (latch) clock: rising edge copies the shift register to QA–QH |
| 13 | nOEInput pin | Output enable, active low: GND = outputs on, high = outputs off (high impedance) |
| 14 | SERInput pin | Serial data in: the next bit, shifted in on the rising SRCLK edge |
| 15 | QAOutput pin | Parallel output A (first bit shifted in last) |
| 16 | VCCSupply pin | Supply 2–6 V: 100 nF to GND |
Parameters 1
Gate delay
tpdDefault10n
PCB
Verified land pattern
SOIC-16_3.9x9.9mm_P1.27mm