Design of 1 Bit Comparator using Logical Gates (Data Flow Modeling Style) -
Verilog CODE-
//-----------------------------------------------------------------------------
//
// Title : comparator_1bit
// Design : verilog upload
// Author : Naresh Singh Dobal
// Company : nsd
//
//-----------------------------------------------------------------------------
//
// File : 1 bit comparator using logical gates.v
module comparator_1bit ( a ,b ,equal ,greater ,lower );
output equal ;
output greater ;
output lower ;
input a ;
input b ;
assign equal = a ~^ b;
assign lower = (~a) & b;
assign greater = a & (~b);
endmodule
Output Waveform : 1 Bit Comparator |
Verilog CODE-
//-----------------------------------------------------------------------------
//
// Title : comparator_1bit
// Design : verilog upload
// Author : Naresh Singh Dobal
// Company : nsd
//
//-----------------------------------------------------------------------------
//
// File : 1 bit comparator using logical gates.v
module comparator_1bit ( a ,b ,equal ,greater ,lower );
output equal ;
output greater ;
output lower ;
input a ;
input b ;
assign equal = a ~^ b;
assign lower = (~a) & b;
assign greater = a & (~b);
endmodule
2 comments :
Thanks a lot dude. I am eager in understanding the design of a computer processor from scratch. Can you help me dude?
what about the code for the test bench
Post a Comment