Introduction to Computer Architecture Question QUESTION 1 Mulitiplier 27_29 Supp
ID: 3600392 • Letter: I
Question
Introduction to Computer Architecture Question
QUESTION 1 Mulitiplier 27_29 Suppose you have implemented a multiplier that uses a 10-bit adder to perferm multiplicatin of two 5-bit unsigned binary numbers You use t calculate 27 29 Find out the brs in each register during the computation. In follawing, each row has three binary numbers for multlipicand, multiplier, and product, respectively The value for multliplier is already given You may want to study the multiplication example in the slides first Use this problem to check if you understand the concepts. 1110 0111 0011 QUES TION 2 Mulitiplier 27 29 2 In this problem, we interpret the results in the previous probiem The valuc of the product (at the end ot compurazion) in decimal is Sometmes tha muitplier can compute product for two's complement numbers if you use the lower half of the produc: only. Let us check if you can get the comect result in this example It you interpret the -br mutipicand as a 5-bit two's complement number, the value is in decimal. If you Interpret the 5-bt mutipler as a 5-be two's camplement number, the value is In decimal). If you interpret the lower 5 bts of the produc: at the end of your computation as a -bn two's complement number, the value is in decimal If you Interpret all 10 bits In the preduct at the end of your computation as a 10 bt two's complement number, the value is In decimaExplanation / Answer
# define a function
def lcm(x, y):
"""This function takes two
integers and returns the L.C.M."""
# choose the greater number
if x > y:
greater = x
else:
greater = y
while(True):
if((greater % x == 0) and (greater % y == 0)):
lcm = greater
break
greater += 1
return lcm
# change the values of num1 and num2 for a different result
num1 = 54
num2 = 24
# uncomment the following lines to take input from the user
#num1 = int(input("Enter first number: "))
#num2 = int(input("Enter second number: "))
print("The L.C.M. of", num1,"and", num2,"is", lcm(num1, num2))
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.