You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

36 lines
504 B

SUBDESIGN sign_to_unsign
(
a, b, c, d : input;
sign, o[4..0] : output;
)
BEGIN
IF d THEN
sign = VCC;
TABLE
!a, !b, !c => o[4..0];
0, 0, 0 => 1;
1, 0, 0 => 2;
0, 1, 0 => 3;
1, 1, 0 => 4;
0, 0, 1 => 5;
1, 0, 1 => 6;
0, 1, 1 => 7;
1, 1, 1 => 8;
END TABLE;
ELSE
sign = GND;
TABLE
a, b, c => o[4..0];
0, 0, 0 => 0;
1, 0, 0 => 1;
0, 1, 0 => 2;
1, 1, 0 => 3;
0, 0, 1 => 4;
1, 0, 1 => 5;
0, 1, 1 => 6;
1, 1, 1 => 7;
END TABLE;
END IF;
END;