-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patharrayport.va
More file actions
23 lines (22 loc) · 884 Bytes
/
Copy patharrayport.va
File metadata and controls
23 lines (22 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Enhancement-89: name-then-range net/port declarations (LRM 3.6/3.7,
// example page 45) -- `output out[0:3];`, `electrical out[0:3];`, the
// unpacked-array form of a vectored port/net, complementing the
// range-then-name form `output [0:3] out;` (Enhancement-3).
//
// A 4-tap fractional buffer (the E-3 bus_buffer, re-declared in the
// name-then-range style): each output tap is a scaled copy of the input,
// out[k] = 0.25*(k+1)*gain*V(in).
`include "disciplines.vams"
module tapbuf(in, out);
input in;
output out[0:3]; // name-then-range output PORT
electrical in;
electrical out[0:3]; // name-then-range output NET
parameter real gain = 1.0 from (0:inf);
analog begin
V(out[0]) <+ 0.25 * gain * V(in);
V(out[1]) <+ 0.50 * gain * V(in);
V(out[2]) <+ 0.75 * gain * V(in);
V(out[3]) <+ 1.00 * gain * V(in);
end
endmodule