Presentation is loading. Please wait.

Presentation is loading. Please wait.

Shifters Lecture L7.4 Section 7.4. MODULE shift TITLE 'shifter' DECLARATIONS " INPUT PINS " D3..D0 PIN 11,7,6,5; D = [D3..D0]; s2..s0 PIN 3,2,1; S.

Similar presentations


Presentation on theme: "Shifters Lecture L7.4 Section 7.4. MODULE shift TITLE 'shifter' DECLARATIONS " INPUT PINS " D3..D0 PIN 11,7,6,5; D = [D3..D0]; s2..s0 PIN 3,2,1; S."— Presentation transcript:

1 Shifters Lecture L7.4 Section 7.4

2

3

4 MODULE shift TITLE 'shifter' DECLARATIONS " INPUT PINS " D3..D0 PIN 11,7,6,5; D = [D3..D0]; s2..s0 PIN 3,2,1; S = [s2..s0]; " OUTPUT PINS " Y3..Y0 PIN 40,41,43,44 ISTYPE 'com'; Y = [Y3..Y0]; noshift = [D3,D2,D1,D0]; shr = [0,D3,D2,D1]; shl = [D2,D1,D0,0 ]; ror = [D0,D3,D2,D1]; rol = [D2,D1,D0,D3]; asr = [D3,D3,D2,D1]; ror2 = [D1,D0,D3,D2]; EQUATIONS

5 EQUATIONS when (S == 0) then Y = noshift; when (S == 1) then Y = shr; when (S == 2) then Y = shl; when (S == 3) then Y = ror; when (S == 4) then Y = rol; when (S == 5) then Y = asr; when (S == 6) then Y = ror2; when (S == 7) then Y = noshift;

6 @radix 16; test_vectors ([D,S] -> Y) [0B,0] -> 0B; [0B,1] -> 5; [0B,2] -> 6; [0B,3] -> 0D; [0B,4] -> 7; [0B,5] -> 0D; [0B,6] -> 0E; [0B,7] -> 0B; END


Download ppt "Shifters Lecture L7.4 Section 7.4. MODULE shift TITLE 'shifter' DECLARATIONS " INPUT PINS " D3..D0 PIN 11,7,6,5; D = [D3..D0]; s2..s0 PIN 3,2,1; S."

Similar presentations


Ads by Google