Nios/shifts

From ASMBits

nios/shiftuPrevious

One common case where you need to shift and truncate numbers is when changing the amplitude of audio samples.

For this problem, write a function (named shift) that will accept a 32-bit signed audio sample, and return a 32-bit signed audio sample with 1/4 of the amplitude. Don't do any rounding (just shift and truncate).

Expected solution length: Around 2 lines.

Sample Input

0x40000

Sample Output

0x10000

Write your solution here

Upload a source file...