mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-11 00:23:26 +00:00
docs: moving code examples
Code now resides in `docs/source/code_examples`. `CHAPTER_Prog` -> `stubnets` `APPNOTE_011_Design_Investigation` -> `selections` and `show` `resources/PRESENTATION_Intro` -> `intro` `resources/PRESENTATION_ExSyn` -> `synth_flow` `resources/PRESENTATION_ExAdv` -> `techmap`, `macc`, and `selections` `resources/PRESENTATION_ExOth` -> `scrambler` and `axis` Note that generated images are not yet configured to build from the new code locations.
This commit is contained in:
parent
3d70867809
commit
dbc38d72cf
119 changed files with 264 additions and 905 deletions
15
docs/source/code_examples/selections/select.v
Normal file
15
docs/source/code_examples/selections/select.v
Normal file
|
@ -0,0 +1,15 @@
|
|||
module test(clk, s, a, y);
|
||||
input clk, s;
|
||||
input [15:0] a;
|
||||
output [15:0] y;
|
||||
reg [15:0] b, c;
|
||||
|
||||
always @(posedge clk) begin
|
||||
b <= a;
|
||||
c <= b;
|
||||
end
|
||||
|
||||
wire [15:0] state_a = (a ^ b) + c;
|
||||
wire [15:0] state_b = (a ^ b) - c;
|
||||
assign y = !s ? state_a : state_b;
|
||||
endmodule
|
Loading…
Add table
Add a link
Reference in a new issue