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: BCD to Excess 3 and Excess 3 to BCD Dataflow Modelling

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

VLSI: 4-1 MUX Dataflow Modelling with Testbench

VLSI: Half Subtractor and Full Subtractor Gate Level Modelling

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