-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzvn.luc
More file actions
37 lines (30 loc) · 791 Bytes
/
zvn.luc
File metadata and controls
37 lines (30 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
module zvn (
input x[16],
input y[16],
input s[16],
input alufn[6],
output z,
output v,
output n
) {
always {
case (alufn[5:0]) {
b000000:
z = ~|s;
v = (x[15] & (y[15]^alufn[0]) & ~s[15]) | (~x[15] & ~(y[15]^alufn[0]) & s[15]) ;
n = s[15];
b000001:
z = ~|s;
v = (x[15] & (y[15]^alufn[0]) & ~s[15]) | (~x[15] & ~(y[15]^alufn[0]) & s[15]) ;
n = s[15];
b000010:
z = ~|s;
v = (~x[15] & y[15] & ~s[15]) | (x[15] & ~y[15] & ~s[15]) | (~x[15] & ~y[15] & s[15]) | (x[15] & y[15] & s[15]);
n = s[15];
default:
z = 0;
v = 0;
n = 0;
}
}
}