Computers And Technology Questions
Which of the following describes a 2×4 decoder? A)-Two AND gates, four Inverters, and one OR gate. B)-Two Inverters, four AND gates, and one OR gate. C)-Two OR gates, four AND gates, and one Inverter. D)-Two Inverters, four OR gates, and one AND gate. E)-Two Inverters, four AND gates, and no OR gates.
A pincode consists of N integers between 1 and 9. In a valid pincode, no integer is allowed to repeat consecutively. Ex: The sequence 1, 2,1, 3 is valid because even though 1 occurs twice, it is not consecutive. However, the sequence 1, 2, 2, 1 is invalid because 2 occurs twice, consecutively. Utilize a for loop and branch statements to write a function called pinCodeCheck to detect and eliminate all the consecutive repetitions in the row array pinCode. The function outputs should be two row arrays. The row array repPos contains the positions pinCode where the consecutive repeats occurs, and the row array pinCodeFix is a valid pincode with all the consecutive repeats removed in pinCode. Hint: The empty array operator [] is will be helpful to use.