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.

  1. The unicode for 🥰 is 1F970. What is the corresponding Octal for this emoji? Justify your answer.
  2. Each of the following Python functions describes one of the combinational circuits MUX, DEMUX, and DECODER. Rename every function so that the function name reflects the circuit it describes.
    	# 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]
    
  3. Consider the truth table below. Use a 4:1 MUX to build the circuit. Indicate what inputs (two out of A, B, C) you would attach to the control bits, and what the four individual inputs would be. Please note that 0 and 1 can be the possible individual inputs. When using 0 as an input, that input only generates 0. When using 1 as an input, that input only generates 1.
    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
    
  4. What is the sum of the products expression for the above 4:1 MUX after figuring out its inputs and control bits?

© 2024 Ying Li. Page last modified: .