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 | 29 | 30 | 31 |
Tags
- test bench
- dataflow modeling
- Recursion
- behavioral modeling
- pwm
- java
- FND
- BASYS3
- stop watch
- i2c 통신
- vivado
- ring counter
- hc-sr04
- soc 설계
- KEYPAD
- Edge Detector
- Algorithm
- D Flip Flop
- half adder
- atmega 128a
- Linked List
- ATMEGA128A
- structural modeling
- Pspice
- uart 통신
- LED
- DHT11
- gpio
- verilog
- prescaling
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 |