vault backup: 2025-02-03 13:23:54
This commit is contained in:
parent
9c785ecdb9
commit
08065a130b
@ -18,7 +18,16 @@ $$ cout = xy + xc_i + yc_i $$
|
|||||||
|
|
||||||
---
|
---
|
||||||
# <u>Solution:</u>
|
# <u>Solution:</u>
|
||||||
## A
|
## a)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## b)
|
||||||
|
|
||||||
|
---
|
||||||
|
## c)
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
---
|
---
|
||||||
# 2.
|
# 2.
|
||||||
@ -27,4 +36,6 @@ $$ cout = xy + xc_i + yc_i $$
|
|||||||
## Given
|
## Given
|
||||||
## Find
|
## Find
|
||||||
---
|
---
|
||||||
|
# <u>Solution</u>
|
||||||
|
---
|
||||||
---
|
---
|
||||||
|
@ -32,24 +32,24 @@ module example1(x1, x2, s, f);
|
|||||||
and(g, k, x1);
|
and(g, k, x1);
|
||||||
and(h, s, x2);
|
and(h, s, x2);
|
||||||
or(f, g, h);
|
or(f, g, h);
|
||||||
|
// You can also do this
|
||||||
|
assign f = (~s & x1) | (s & x2);
|
||||||
endmodule
|
endmodule
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- Structural Verilog describes how things are laid out at a logic level.
|
||||||
|
-
|
||||||
```verilog
|
```verilog
|
||||||
// V---V---v--v-----portlist (not ordered)
|
// V---V---v--v-----portlist (not ordered)
|
||||||
module example1(x1, x2, s, f);
|
module example1(x1, x2, s, f);
|
||||||
// Defining the types of the various ports
|
// Defining the types of the various ports
|
||||||
input x1, x2, s;
|
input x1, x2, s;
|
||||||
output f;
|
output f;
|
||||||
// You can also do this
|
|
||||||
assign f = (~s & x1) | (s & x2);
|
|
||||||
// Or this
|
|
||||||
always @(a, b)
|
always @(a, b)
|
||||||
// always @(....) says "do this stuff whenever any of the values inside of @(...) change"
|
// always @(....) says "do this stuff whenever any of the values inside of @(...) change"
|
||||||
{s1, s0} = a + b;
|
{s1, s0} = a + b;
|
||||||
endmodule
|
endmodule
|
||||||
```
|
```
|
||||||
- Structural Verilog describes how things are laid out at a logic level
|
|
||||||
|
|
||||||
## Testbench Layout
|
## Testbench Layout
|
||||||
- Define UUT module
|
- Define UUT module
|
||||||
|
Loading…
x
Reference in New Issue
Block a user