Due: Friday, September 20, 2024, 11:00 am (start of the class)
Email Ying your homework. The email subject should follow this format CS232 Fall2024 HW2 -- Your Name.
1F970. What is the corresponding Octal for this emoji? Justify your answer.
# I is a string with length 2 def FUNC1(I): # 2 inputs, 4 outputs if I = “00”: return [1, 0, 0, 0] elif I = “01”: return [0, 1, 0, 0] elif I = “10”: return [0, 0, 1, 0] else: return [0, 0, 0, 1] # I is a list with length 4, and C is a string with length 2 def FUNC2 (I, C): # 2 controls, 4 inputs, 1 output if C = “00”: return I[0] elif C = “01”: return I[1] elif C = “10”: return I[2] else: return I[3] # I is a variable that can be either 1 or 0, C is a string with # length 2 def FUNC3(I, C): # 1 input, 2 controls, 4 outputs if C = “00”: return [I, 0, 0, 0] elif C = “01”: return [0, I, 0, 0] elif C = “10”: return [0, 0, I, 0] else: return [0, 0, 0, I]
A B C F 0 0 0 1 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0
© 2024 Ying Li. Page last modified: .