Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For signed and unsigned multiplication, fill in the following table showing the

ID: 3756841 • Letter: F

Question

For signed and unsigned multiplication, fill in the following table showing the results of multiplying different 5-bit numbers, in the style of Figure 2.27 of textbook (page 98) for w=5, by replacing "decimal" with decimal values and "binary" with binary values.

Do problem 2.77.

Write a C program to print the binary values of a floating point number passed as a parameter, as demonstrated in class, by filling in ftob.c. For example, it would print "0 01111110 10000000000000000000000" when you type "ftob 0.75." So would it "0 01111101 00110011001100110011010" when you type "ftob 0.3" as demonstrated in class.

Round the following fractional values to the nearest quarter (2 bits to the right of the binary point), according to the round-to-even rule in the style of page 26 of Lecture note 4 (04-float.pdf).

Convert the following decimal values to 9-bit floats, where bit 8 (the most signifincant bit) is the sign bit, bits 4-7 are exponents, and the rest (bits 0-3) are the significand. Follow the format of page 39 of Lecture note 4 (04-float.pdf).

Write a C program to print the decimal value of a binary string passed as a parameter. For example, it would print 0.75 when you type "0 01111110 10000000000000000000000."
As another example, it would print 0.125 when you type "0 01111100 00000000000000000000000."

Mode x y x*y, w=10 Truncated x*y, w=5 (a) Unsigned decimal 10000 decimal 10101 decimal binary decimal binary Two's complement decimal 10000 decimal 10101 decimal binary decimal binary (b) Unsigned decimal 10101 decimal 01000 decimal binary decimal binary Two's complement decimal 10101 decimal 01000 decimal binary decimal binary (c) Unsigned decimal 01100 decimal 11001 decimal binary decimal binary Two's complement decimal 01100 decimal 11001 decimal binary decimal binary (d) Unsigned decimal 01010 decimal 00101 decimal binary decimal binary Two's complement decimal 01010 decimal 00101 decimal binary decimal binary Mode Truncatedx -y 5 [101 3 [011 15 [00111 7[111] 4 [100] 7 [1] 28 [011100 4 [100] 3 01 3 [oH] 9 -[001001]. 1[001] Unsigned Two's complement 3 [101] 3 (011] -9 [110111] -1[111] Unsigned Two's complement -4[100] -1 [111] 4 [0001001-4 [100] Unsigned Two's complement 3 [011 3 [011 9 [001001] 1[001) Figure 2.27 Three-bit unsigned and two's-complement multiplication examplese Although the bit-level representations of the full products may differ, those of the truncated products are identical

Explanation / Answer

#include <stdio.h>

int bin_conv(int);

int main()
{
int numb, binaryy;

printf("Enter a decimal number: ");
scanf("%d", &numb);
binaryy = bin_conv(numb);
printf("The binary equivalent of %d is %d ", numb, binaryy);
}

int bin_conv(int numb)
{
if (numb == 0)
{
return 0;
}
else
{
return (numb % 2) + 10 * bin_conv(numb / 2);
}
}