SlideShare a Scribd company logo
1 of 6
4
clk
D Q
0
1
1
2clk
3
clk
clk
たぶんできる!
Verilog-HDL
みつみつ
@aiobo
Syntax
1 module adder(a, b, y);
2 input [7:0] a, b;
3 output [7:0] y;
4
5 assign y = a + b;
6
7 endmodule adder
a
b
8
8
8
y
2
State machine
順序回路を手計算で回路合成する作業は
退屈だし間違いを引き起こしやすい。
HDLで記述し、回路合成・最適化は
(ある程度)シンセサイザに任せる。
3
16bit Counter
7 reg [15:0] creg; //16bit register
8 always @(posedge clk) begin
9 if(rst == 1’b0)
10 creg <= 0;
11 else
12 creg <= creg + 1;
13 end
14 assign out = creg;
15 endmodule
4
Simulator
Icarus Verilog
+
GTKwave
がオススメ
5
References
「入門Verilog HDL記述
ハードウェア記述言語の速習&実践」
小林 優 著
CQ出版
6

More Related Content

Viewers also liked

Verilog code all
Verilog code allVerilog code all
Verilog code allMNIT jaipur
 
Verilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with ExamplesVerilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with ExamplesE2MATRIX
 
verilog code for logic gates
verilog code for logic gatesverilog code for logic gates
verilog code for logic gatesRakesh kumar jha
 
Verilog codes and testbench codes for basic digital electronic circuits.
Verilog codes and testbench codes for basic digital electronic circuits. Verilog codes and testbench codes for basic digital electronic circuits.
Verilog codes and testbench codes for basic digital electronic circuits. shobhan pujari
 
Experiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesExperiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesRicardo Castro
 
Most wanted "peacemakers"
Most wanted "peacemakers"Most wanted "peacemakers"
Most wanted "peacemakers"drpobeda
 
Presentatie Happy Customers - Event Durf te weten! - Kom in beweging!
Presentatie Happy Customers - Event Durf te weten! - Kom in beweging!Presentatie Happy Customers - Event Durf te weten! - Kom in beweging!
Presentatie Happy Customers - Event Durf te weten! - Kom in beweging!Etienne Jager
 
LNA Presentation to Ciena
LNA Presentation to CienaLNA Presentation to Ciena
LNA Presentation to CienaPaul Mushubi
 
DeKlantrede2015-H3ROES
DeKlantrede2015-H3ROESDeKlantrede2015-H3ROES
DeKlantrede2015-H3ROESEtienne Jager
 
Fire Engineering Article_Published_McCrindle
Fire Engineering Article_Published_McCrindleFire Engineering Article_Published_McCrindle
Fire Engineering Article_Published_McCrindleScott McCrindle
 
12.05.29 dien ap buoc1
12.05.29 dien ap buoc112.05.29 dien ap buoc1
12.05.29 dien ap buoc1Bình Lê
 
E6 u15 a14.ppt phuong(1)
E6 u15 a14.ppt phuong(1)E6 u15 a14.ppt phuong(1)
E6 u15 a14.ppt phuong(1)phuongtuanngoc
 

Viewers also liked (20)

Verilog code all
Verilog code allVerilog code all
Verilog code all
 
Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
 
07 sequential verilog
07 sequential verilog07 sequential verilog
07 sequential verilog
 
Verilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with ExamplesVerilog Tutorial - Verilog HDL Tutorial with Examples
Verilog Tutorial - Verilog HDL Tutorial with Examples
 
verilog code for logic gates
verilog code for logic gatesverilog code for logic gates
verilog code for logic gates
 
Verilog codes and testbench codes for basic digital electronic circuits.
Verilog codes and testbench codes for basic digital electronic circuits. Verilog codes and testbench codes for basic digital electronic circuits.
Verilog codes and testbench codes for basic digital electronic circuits.
 
Verilog HDL
Verilog HDLVerilog HDL
Verilog HDL
 
Experiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesExperiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gates
 
VERILOG CODE
VERILOG CODEVERILOG CODE
VERILOG CODE
 
Most wanted "peacemakers"
Most wanted "peacemakers"Most wanted "peacemakers"
Most wanted "peacemakers"
 
Lingkungan Hidup
Lingkungan HidupLingkungan Hidup
Lingkungan Hidup
 
Presentatie Happy Customers - Event Durf te weten! - Kom in beweging!
Presentatie Happy Customers - Event Durf te weten! - Kom in beweging!Presentatie Happy Customers - Event Durf te weten! - Kom in beweging!
Presentatie Happy Customers - Event Durf te weten! - Kom in beweging!
 
LNA Presentation to Ciena
LNA Presentation to CienaLNA Presentation to Ciena
LNA Presentation to Ciena
 
σαν μιλούν οι σαρακατσαναίοι...
σαν μιλούν οι σαρακατσαναίοι...σαν μιλούν οι σαρακατσαναίοι...
σαν μιλούν οι σαρακατσαναίοι...
 
DeKlantrede2015-H3ROES
DeKlantrede2015-H3ROESDeKlantrede2015-H3ROES
DeKlantrede2015-H3ROES
 
IamExpat Fair 2016
IamExpat Fair 2016IamExpat Fair 2016
IamExpat Fair 2016
 
A yoga day
A yoga dayA yoga day
A yoga day
 
Fire Engineering Article_Published_McCrindle
Fire Engineering Article_Published_McCrindleFire Engineering Article_Published_McCrindle
Fire Engineering Article_Published_McCrindle
 
12.05.29 dien ap buoc1
12.05.29 dien ap buoc112.05.29 dien ap buoc1
12.05.29 dien ap buoc1
 
E6 u15 a14.ppt phuong(1)
E6 u15 a14.ppt phuong(1)E6 u15 a14.ppt phuong(1)
E6 u15 a14.ppt phuong(1)