DCO Part B Codes - UPDATED
DCO Part B Codes - UPDATED
//JK Flip op
// D Flip-Flop
module jk_ ip_ op (d,clk,q);
input d,clk;
output reg q;
always @(posedge clk) begin
If (d=1)
q <= 1;
else
q<=0;
end
endmodule
// RS Flip-Flop
module sr_ ip_ op (s,r,clk,q);
input s,r,clk;
output reg q;
ti
fl
fl
fl
fl
fl
fl
fl
ti
always @(posedge clk) begin
case ({s, r})
2'b00: q <= q; // No change
2'b01: q <= 0; // Reset
2'b10: q <= 1; // Set
2'b11: q <= 0; // indeterminate
end
endmodule