Skip to content

Commit 9c3715a

Browse files
committed
feat other
1 parent a6815b3 commit 9c3715a

File tree

8 files changed

+146
-4
lines changed

8 files changed

+146
-4
lines changed

lib/adder/full_adder/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,23 @@ full_adder(input A, B, Ci, output Co, S)
77
![RTL_View](./assets/RTL_view.png)
88
![Symbol](./assets/Symbol.png)
99

10-
> Equivalent module:
10+
### Other logic full adder
1111

1212
```v
13-
module full_adder(input A, B, Ci, output Co, S);
13+
module s_full_adder(input A, B, Ci, output Co, S);
1414
assign S = A ^ B ^ Ci;
1515
assign Co = (A & B) | ((A ^ B) & Ci);
1616
endmodule
1717
```
1818

19+
![S-Full adder](assets/s_RTL_view.png)
20+
21+
> Verilog special syntax
22+
1923
```v
20-
module full_adder(input A, B, Ci, output Co, S);
24+
module v_full_adder(input A, B, Ci, output Co, S);
2125
assign {Co, S} = A + B + Ci;
2226
endmodule
2327
```
28+
29+
![V-Full adder](assets/v_RTL_view.png)
10.7 KB
Loading
9.48 KB
Loading
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
WARNING: Do NOT edit the input and output ports in this file in a text
3+
editor if you plan to continue editing the block that represents it in
4+
the Block Editor! File corruption is VERY likely to occur.
5+
*/
6+
/*
7+
Copyright (C) 1991-2010 Altera Corporation
8+
Your use of Altera Corporation's design tools, logic functions
9+
and other software and tools, and its AMPP partner logic
10+
functions, and any output files from any of the foregoing
11+
(including device programming or simulation files), and any
12+
associated documentation or information are expressly subject
13+
to the terms and conditions of the Altera Program License
14+
Subscription Agreement, Altera MegaCore Function License
15+
Agreement, or other applicable license agreement, including,
16+
without limitation, that your use is for the sole purpose of
17+
programming logic devices manufactured by Altera and sold by
18+
Altera or its authorized distributors. Please refer to the
19+
applicable agreement for further details.
20+
*/
21+
(header "symbol" (version "1.1"))
22+
(symbol
23+
(rect 16 16 112 112)
24+
(text "s_full_adder" (rect 5 0 29 12)(font "Arial" ))
25+
(text "inst" (rect 8 80 25 92)(font "Arial" ))
26+
(port
27+
(pt 0 32)
28+
(input)
29+
(text "A" (rect 0 0 7 12)(font "Arial" ))
30+
(text "A" (rect 21 27 28 39)(font "Arial" ))
31+
(line (pt 0 32)(pt 16 32)(line_width 1))
32+
)
33+
(port
34+
(pt 0 48)
35+
(input)
36+
(text "B" (rect 0 0 7 12)(font "Arial" ))
37+
(text "B" (rect 21 43 28 55)(font "Arial" ))
38+
(line (pt 0 48)(pt 16 48)(line_width 1))
39+
)
40+
(port
41+
(pt 0 64)
42+
(input)
43+
(text "Ci" (rect 0 0 10 12)(font "Arial" ))
44+
(text "Ci" (rect 21 59 31 71)(font "Arial" ))
45+
(line (pt 0 64)(pt 16 64)(line_width 1))
46+
)
47+
(port
48+
(pt 96 32)
49+
(output)
50+
(text "Co" (rect 0 0 14 12)(font "Arial" ))
51+
(text "Co" (rect 61 27 75 39)(font "Arial" ))
52+
(line (pt 96 32)(pt 80 32)(line_width 1))
53+
)
54+
(port
55+
(pt 96 48)
56+
(output)
57+
(text "S" (rect 0 0 7 12)(font "Arial" ))
58+
(text "S" (rect 68 43 75 55)(font "Arial" ))
59+
(line (pt 96 48)(pt 80 48)(line_width 1))
60+
)
61+
(drawing
62+
(rectangle (rect 16 16 80 80)(line_width 1))
63+
)
64+
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module s_full_adder(input A, B, Ci, output Co, S);
22
assign S = A ^ B ^ Ci;
3-
assign Co = (A & B) + (B & Ci) + (A & Ci);
3+
assign Co = (A & B) | (B & Ci) | (A & Ci);
44
endmodule
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
WARNING: Do NOT edit the input and output ports in this file in a text
3+
editor if you plan to continue editing the block that represents it in
4+
the Block Editor! File corruption is VERY likely to occur.
5+
*/
6+
/*
7+
Copyright (C) 1991-2010 Altera Corporation
8+
Your use of Altera Corporation's design tools, logic functions
9+
and other software and tools, and its AMPP partner logic
10+
functions, and any output files from any of the foregoing
11+
(including device programming or simulation files), and any
12+
associated documentation or information are expressly subject
13+
to the terms and conditions of the Altera Program License
14+
Subscription Agreement, Altera MegaCore Function License
15+
Agreement, or other applicable license agreement, including,
16+
without limitation, that your use is for the sole purpose of
17+
programming logic devices manufactured by Altera and sold by
18+
Altera or its authorized distributors. Please refer to the
19+
applicable agreement for further details.
20+
*/
21+
(header "symbol" (version "1.1"))
22+
(symbol
23+
(rect 16 16 112 112)
24+
(text "v_full_adder" (rect 5 0 29 12)(font "Arial" ))
25+
(text "inst" (rect 8 80 25 92)(font "Arial" ))
26+
(port
27+
(pt 0 32)
28+
(input)
29+
(text "A" (rect 0 0 7 12)(font "Arial" ))
30+
(text "A" (rect 21 27 28 39)(font "Arial" ))
31+
(line (pt 0 32)(pt 16 32)(line_width 1))
32+
)
33+
(port
34+
(pt 0 48)
35+
(input)
36+
(text "B" (rect 0 0 7 12)(font "Arial" ))
37+
(text "B" (rect 21 43 28 55)(font "Arial" ))
38+
(line (pt 0 48)(pt 16 48)(line_width 1))
39+
)
40+
(port
41+
(pt 0 64)
42+
(input)
43+
(text "Ci" (rect 0 0 10 12)(font "Arial" ))
44+
(text "Ci" (rect 21 59 31 71)(font "Arial" ))
45+
(line (pt 0 64)(pt 16 64)(line_width 1))
46+
)
47+
(port
48+
(pt 96 32)
49+
(output)
50+
(text "Co" (rect 0 0 14 12)(font "Arial" ))
51+
(text "Co" (rect 61 27 75 39)(font "Arial" ))
52+
(line (pt 96 32)(pt 80 32)(line_width 1))
53+
)
54+
(port
55+
(pt 96 48)
56+
(output)
57+
(text "S" (rect 0 0 7 12)(font "Arial" ))
58+
(text "S" (rect 68 43 75 55)(font "Arial" ))
59+
(line (pt 96 48)(pt 80 48)(line_width 1))
60+
)
61+
(drawing
62+
(rectangle (rect 16 16 80 80)(line_width 1))
63+
)
64+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module v_full_adder(input A, B, Ci, output Co, S);
2+
assign {Co, S} = A + B + Ci;
3+
endmodule

scripts/README.template.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# verilog-library
22

3+
## Naming conventions
4+
5+
1. `s_`: Less Clock version
6+
2. `v_`: Verilog special syntax
7+
38
[TOC]
49

510
{CONTENT}

0 commit comments

Comments
 (0)