Latest Post

Ads

VLSI: 2 Bit Magnitude Comparator Dataflow Modelling

Image result for 2 bit magnitude comparator

module mag_comp2bit(
    input a0,
    input a1,
    input b0,
    input b1,
    output p,   // p = (a < b)
    output r,    // r = (a > b)
    output q    // q = (a = b)
    );
assign q = ((~a1) ^ (b1)) & (a0 & b0);
assign p = (((~a1) & b1) | (b0 & (~a0) & (~a1)) | ((~a0) & b1 & b0));
assign r = ((a1 & (~b1)) | ((~b0) & a1 & a0) | (a0 & (~b1) & (~b0)));

endmodule

Ads

Popular posts from this blog

VLSI: 1-4 DEMUX (Demultiplexer) Dataflow Modelling with Testbench

VLSI: BCD to Excess 3 and Excess 3 to BCD Dataflow Modelling

1 to 4 DEMUX (Demultiplexer) Verilog CodeStructural/Gate Level Modelling with Testbench

Full Subtractor Verilog Code in Structural/Gate Level Modelling with Testbench