Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

// DSCH 2.

7f
// 19/10/2021 01:49:52
// D:\EECE 318 (VLSI I Lab)\Magnitude comparator.sch

1 module Magnitude comparator( B2,in1,in1,in1,B0,in1,A0,in1,


2 B1,in1,A2,in1,in1,in1,A1,in1,
3 in1,B2,AiB,AsB,AeB);
4 input B2,in1,in1,in1,B0,in1,A0,in1;
5 input B1,in1,A2,in1,in1,in1,A1,in1;
6 input in1,B2;
7 output AiB,AsB,AeB;
8 not #(10) inv(w2,A2);
9 not #(10) inv(w4,B2);
10 and #(23) and(w5,B2,w2);
11 and #(23) and(w6,w4,A2);
12 nor #(30) or(w7,w5,w6);
13 and #(16) and(w10,w8,w9);
14 and #(16) and(w12,w11,w7);
15 and #(16) and(AeB,w7,w9,w13);
16 nor #(16) or(w13,w8,w15);
17 and #(23) and(w15,w16,A0);
18 not #(10) inv(w19,A1);
19 not #(10) inv(w21,B1);
20 and #(23) and(w11,B1,w19);
21 and #(23) and(w22,w21,A1);
22 nor #(30) or(w9,w11,w22);
23 not #(10) inv(w23,A0);
24 not #(10) inv(w16,B0);
25 and #(23) and(w8,B0,w23);
26 and #(16) and(w25,w15,w9);
27 and #(16) and(w26,w22,w7);
28 or #(19) or(AiB,w5,w12,w10);
29 or #(19) or(AsB,w6,w26,w25);
30 endmodule

// Simulation parameters in Verilog Format


always
#1000 B2=~B2;
#2000 in1=~in1;
#4000 in1=~in1;
#8000 in1=~in1;
#16000 B0=~B0;
#32000 in1=~in1;
#64000 A0=~A0;
#128000 in1=~in1;
#256000 B1=~B1;
#512000 in1=~in1;
#1024000 A2=~A2;
#2048000 in1=~in1;
#4096000 in1=~in1;
#8192000 in1=~in1;
#16384000 A1=~A1;
#32768000 in1=~in1;
#65536000 in1=~in1;
#131072000 B2=~B2;

// Simulation parameters
// B2 CLK 10 10
// in1 CLK 20 20
// in1 CLK 40 40
// in1 CLK 80 80
// B0 CLK 160 160
// in1 CLK 320 320
// A0 CLK 640 640
// in1 CLK 1280 1280
// B1 CLK 2560 2560
// in1 CLK 5120 5120
// A2 CLK 10240 10240
// in1 CLK 20480 20480
// in1 CLK 40960 40960
// in1 CLK 81920 81920
// A1 CLK 163840 163840
// in1 CLK 327680 327680
// in1 CLK 655360 655360
// B2 CLK 1310720 1310720

You might also like