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

You are asked to write a program in pseudo language to realize multiplication of

ID: 3735627 • Letter: Y

Question

You are asked to write a program in pseudo language to realize multiplication of two 7-bit binary numbers according to the ADD and Shift algorithm discussed during the lecture. Assume they are positive numbers) that are already stored in 8-bit register A and B, and your code store the results in registers C and D in binary format. Also, assume the Followings:

---An 8-bit machine having eight registers (A through H), and ALU capable of ADD, AND, and NOT functions. Also, this machine has a shifter capable of shift_left, shift_right, and no_shift. Shifter’s left_in and right_in is always 0. I.e. your pseudo code is required to implement bit detection for the purpose of multiplying.

---You may assign any initial binary value to any registers to make your system functional.

Your pseudo code must be typed and followed by the following two input examples (for Aand B) and the multiplication results (C and D).

A := 1101011 B := 1000001

A := 1010101 B := 1001100

When testing with above examples, you need to indicate the values of registers whenever

their values are updated.

Explanation / Answer

Pseudo Code: Write "please enter 5 numbers" Read n1, n2, n3, n4, n5

Write "The average is" Set avg to (n1+n2+n3+n4+n5)/5

Write avg If (n1 < n2) Set max to n2 Else Set max to n1

If (n3 > max) Set max to n3

If (n4 > max) Set max to n4

If (n5 > max) Set max to n5 Write "The max is" Write max

If (n1 > n2) Set min to n2 Else Set min to n1

If (n3 < min) Set min to n3

If (n4 < min) Set min to n4

If (n5 < min) Set min to n5 Write "The min is" Write min

CH code:

cout<<"please enter 5 numbers";

int n1,n2,n3,n4,n5;

cin>>n1>>n2>>n3>>n4>>n5;

int avg = (n1+n2+n3+n4+n5)/5;

cout<<"The average is "<<avg;

int min, max;

if(n1<n2)

max=n2;

else

max=n1;

if(n3>max)

max=n3;

if(n4>max)

max=n4;

if(n5>max)

max=n5;

cout<<"The max is "<<max;

if(n1>n2)

min=n2;

else

min=n1;

if(n3<min)

min=n3;

if(n4<min)

min=n4;

if(n5<min)

min=n5;

cout<<"The min is "<<min;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote