Implement a system that receives as input 2 variables A B ea

Implement a system that receives as input 2 variables A, B, each variable consisting of k bits, and a flag variable F consisting of 2 bits; and outputs a k bit variable Y based on the following rule. Let n_A be the number of 1\'s in A. In what follows let A_[2:0] and B_[2:0] the 3 least significant bits of A and B respectively. Namely, if A_k = A_k-1 A_k-2 ... A_2 A_1 A_0 then A[2:0] = A_2A_1A_0. If F = 00 then the output Y will be equal to n_A. If F = 01 then the output Y will be equal to A[2:0] multiplied by B[2:0]. Here, we consider A[2: 0] and B[2;0] to represent numbers in standard binary form. If F = 10 then the output Y will be equal to the absolute value of A + B, where A and B are considered to be in 2\'s complement form (with k bits). If F = 11 then the output Y will be equal to the rotation of A, n_A location to the right. Construct a circuit that performs the above functionality. In your solution follow the steps below. Draw the circuits in an organized and readable manner (points will be reduced for solutions that are difficult to understand). Construct circuits that are as small as possible. You may use MUXs in you solutions. Implement a circuit COUNT that receives A as input and computes n_A. Implement a circuit MUL that receives two 3 bit inputs A[2:0] and B[2;0] and outputs their product. Here, we consider and B[2:0] to represent numbers in standard binary form. Implement a circuit ABS that receives a k bit input A and computes the absolute value of A. Here A is considered to be in 2\'s complement form with k bits. Implement a circuit ROT that receives A and nA as input and outputs the rotation of A, n_A locations to the right. Use the circuits COUNT, KUL, ABS, and ROT to implement the required complete system that takes as input A, B and F and computes output Y. You may represent the circuits COUNT. MUL. ABS. and ROT by their names (no need to draw the detailed implementation again in this section). Analyze the size and computation time of your final circuit (rough estimates as a function of k arc sufficient). Show all details of your calculation.

Solution

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
  
if(a[i]>0)
  

if(d[i]>0)
printf(\" + \");
else if(d[i]<0)
printf(\" - \");
else
printf(\" \");
printf(\"%dx^%d\",d[i],i-1);
}
getch();
}
#include <stdio.h>
#include <stdlib.h>

typedef struct polynomial Polynomial;

void init_poly(Polynomial *p)

void print_poly(Polynomial *p)
p->coefficient[p->order--] = 0;
}

void r_print_differential_poly(Polynomial *p)
}

int main(void)

 Implement a system that receives as input 2 variables A, B, each variable consisting of k bits, and a flag variable F consisting of 2 bits; and outputs a k bit

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site