Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- java
- dataflow modeling
- behavioral modeling
- verilog
- half adder
- atmega 128a
- DHT11
- KEYPAD
- stop watch
- ring counter
- vivado
- Pspice
- uart 통신
- test bench
- gpio
- Algorithm
- soc 설계
- BASYS3
- prescaling
- structural modeling
- i2c 통신
- Edge Detector
- Linked List
- Recursion
- pwm
- LED
- D Flip Flop
- FND
- ATMEGA128A
- hc-sr04
Archives
- Today
- Total
거북이처럼 천천히
Module with parameters 본문
1. Module with parametes (N bit comparator)
< Source >
// Module with parameter
module Module_with_parameters #(parameter N=8)(
input [N-1:0] a, b,
output equal, greater, less);
assign equal = (a == b)? 1 : 0;
assign greater = (a > b)? 1 :0;
assign less = (a < b)? 1 : 0;
endmodule
2. 4 bit Comparator by using module with parameter
< Source >
// Module with parameter
module Module_with_parameters #(parameter N=8)(
input [N-1:0] a, b,
output equal, greater, less);
assign equal = (a == b)? 1 : 0;
assign greater = (a > b)? 1 :0;
assign less = (a < b)? 1 : 0;
endmodule
// 4bit Comparator
module comparator_4bit_by_using_parameter_module (
input [3:0] a, b,
output equal, greater, less);
Module_with_parameters #(.N(4)) comparator(.a(a), .b(b), .equal(equal), .greater(greater), .less(less));
endmodule
< Simulation >
< RTL analysis >
< Synthesis >
'RTL Design > Verilog 연습' 카테고리의 다른 글
Verilog 연습 리스트 (0) | 2024.07.07 |
---|---|
4 X 2 Encoder / 2 X 4 Decoder (0) | 2024.07.01 |
4 bit Comparator / 32 bit Comparator (0) | 2024.06.30 |
1 bit Comparator (0) | 2024.06.30 |
4 bit parallel adder / subtractor (0) | 2024.06.30 |