In: Electrical Engineering
Jack wants to build a circuit to shift 4 bits (I0 to I3 from left to right) in a circular way. One extra bit (S) is used to control the direction of shifting. When S = 0, the bits should be shifted left, otherwise right. The outputs are O0 to O3 from left to right. For example, when shifted right, 0011 would become 1001; when shifted left, 0011 would become 0110.
Please help Jack get started by providing the fourth and 20-th row of the truth table for O2, and the fourth and 20-th row for O1. Each row should be formatted as (S,I0,I1,I2,I3,Output) and the rows should be separated by comma. The answer should look like (0,0,0,0,0,0),(1,1,1,1,1,1),(0,0,0,0,0,0),(1,1,1,1,1,1). All inputs as 0 is the first row and all inputs as 1 is the last row in the truth table.
truth table for the given question with 4th and 20th row highlighted using dotted lines