|
//
// Title : (164) 8-BIT PARALLEL-OUT SERIAL SHIFT REGISTERS
// File name : 164.v
// Date : 2000/12/08 Ver1.0
// Company : Future Technology Ltd.
//
//---------------------------------------------------------
// Module
//---------------------------------------------------------
module U164 (
XCLR,
CLK,
A,
B,
QA,
QB,
QC,
QD,
QE,
QF,
QG,
QH
);
input XCLR;
input CLK;
input A;
input B;
output QA;
output QB;
output QC;
output QD;
output QE;
output QF;
output QG;
output QH;
//----------------------------------------------------------
// Using register
//----------------------------------------------------------
reg QA;
reg QB;
reg QC;
reg QD;
reg QE;
reg QF;
reg QG;
reg QH;
always@(negedge XCLR or posedge CLK)begin
if(XCLR==1'b0)begin
QA <= 1'b0;
QB <= 1'b0;
QC <= 1'b0;
QD <= 1'b0;
QE <= 1'b0;
QF <= 1'b0;
QG <= 1'b0;
QH <= 1'b0;
end else begin
QA <= A & B;
QB <= QA;
QC <= QB;
QD <= QC;
QE <= QD;
QF <= QE;
QG <= QF;
QH <= QG;
end
end
endmodule
|