Question

Solving digital system problems using MATLAB Write a MATLAB script CTask2p3.m to: a) Generate the...

Solving digital system problems using MATLAB Write a MATLAB script CTask2p3.m to: a) Generate the truth table for the following Boolean expressions and display it in the MATLAB command window (Use logical functions: and, not, or)

0 0
Answer #1

Solution: Part a: Code: octave:59> fprintf( fprintf( AA BB CC DD XX\n); fprintf(- -In) for AA = [0 1] for BB = [O 1] for

Copyable code:

%Print statements

fprintf("-----------\n")

fprintf(" AA BB CC DD XX\n");

fprintf("-----------\n")

%Loops

for AA = [0 1]

for BB = [0 1]

for CC = [0 1]

for DD = [0 1]

%Expression

XX = or ((and(AA,BB)),(and(CC,DD)));

fprintf(" %d %d %d %d %d\n", AA, BB, CC, DD, XX);

end

end

end

end

%Second expression

fprintf("-----------\n")

fprintf(" AA YY\n");

fprintf("-----------\n")

for AA = [0 1]

YY = and(AA,and(AA,AA));

fprintf(" %d %d\n", AA, YY);

end

Part b: Code: octave: 142> %Part 1 bin num = 10011011; dec_num-bin2dec(bin num); fprintf(\n\nConverted decimal number:%d ,

Copyable code:

%Part 1

bin_num = '10011011';

dec_num=bin2dec(bin_num);

fprintf("\n\nConverted decimal number:%d",dec_num);

%Part 2

dec_num = 137;

bin_num=dec2bin(dec_num);

fprintf("\n\nConverted binary number:%s",bin_num);

%Part 3

hex_num = 'A4C3';

dec_num=hex2dec(hex_num);

fprintf("\n\nConverted decimal number:%d",dec_num);

%Part 4

dec_num = 52710;

hex_num=dec2hex(dec_num);

fprintf("\n\nConverted hexadecimal number:%s",hex_num);

Know the answer?
Add Answer to:
Solving digital system problems using MATLAB Write a MATLAB script CTask2p3.m to: a) Generate the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • a) Generate the truth table for the following Boolean expressions and display it in the MATLAB...

    a) Generate the truth table for the following Boolean expressions and display it in the MATLAB command window (Use logical functions: and, not, or) X (A. B) (C. D) Y-ACD b) Solve the following questions and hence to verify your calculated result. (You may use bi2de, de2bi, hex2dec and dec2hex) i Convert the binary number 10011011into decimal ii) Convert the decimal number 137 into binary Convert the hexadecimal number A4C3 into decimal iv) Convert the decimal number 52710 into hexadecimal.

  • 1) Write a MATLAB script to prompt a user to input two numbers, then assess whether...

    1) Write a MATLAB script to prompt a user to input two numbers, then assess whether the two numbers are equal or not. If the two numbers are equal, display that they are equal in the Command Window. If they are not equal, display that they are not equal in the Command Window. 2) Write a MATLAB script that prompts the user to enter the day of the week using the input function. If the information the user enters is...

  • In MATLAB code please Problems 1. Create a script file called Lab10.m containing your work for...

    In MATLAB code please Problems 1. Create a script file called Lab10.m containing your work for the following problems to be uploaded to Canvas under Lab 10. 2. Create symbolic expressions for the following and display them using the pretty command ay 2c2 3. Create the following symbolic equations: 3 4. Factor the following expressions and collect like terms: ax2 - 18az+77a 42 +68x +240

  • Write a Matlab script to generate random sequence of 10 bits using AMI, Manchester techniques and...

    Write a Matlab script to generate random sequence of 10 bits using AMI, Manchester techniques and draw 2 plots. The third plot will display the combination of AMI and Manchester data.

  • The matlab code for the following problem is appreciated!! QUESTION 3 Write a function fnfr_plot that...

    The matlab code for the following problem is appreciated!! QUESTION 3 Write a function fnfr_plot that will receive two function handles from elementary math functions which accept a vector to first sort in ascending order then calculate. The script will display the results in two separate Figure Windows with the function names in the title. Submit: fnfr_plot.m Browse My Computer Attach File QUESTION 4 Generate 1x100 random vector, x in the range of 0<x<100 by using rand. Input 2 elementary...

  • Use MATLAB in all problems and be sure to use suitable MATLAB variable names. a) Write...

    Use MATLAB in all problems and be sure to use suitable MATLAB variable names. a) Write a single line command to create an array sentenceB which stores the contents of array sentenceA in reverse. Hint: end:-1:1 b) Initialize a string array named sentenceA containing: ‘She ZZZZZ XXXYYYYYY by the XXXshore,’ Write a script using a for-loop (without using the MATLAB command strrep()) to replace according to the below: Replace XXX with ‘Sea’ Replace ZZZZZ ‘Sells’ Replace YYYYYY with ‘SHELLS’ c)...

  • Please use Matlab to solve and show your full codes Write a script file Ask the...

    Please use Matlab to solve and show your full codes Write a script file Ask the user to enter sides of a triangle: a, b, c Check to see if the sides are all greater than 0 If they are: Use the function (triangle) that you created in your last homework problem (HW#5 problemttF) to calculate the area. command Display the results on the screen using fprintf write the results to disk using the fprintf command. If any of the...

  • In MATLAB Write a script to determine the number of terms required for the sum of...

    In MATLAB Write a script to determine the number of terms required for the sum of the series (5k? – 2k) not to exceed 100,000 using the while loop. Display the number of terms and the calculated sum using fprint () command as follow: The number of terms is 38 and its sum is 93613

  • Please solve the problems from 1_5 Digital system Complete the following homework problems. Show all work...

    Please solve the problems from 1_5 Digital system Complete the following homework problems. Show all work (making sure it is legible) and circle all answers for clarity Problem 1 w3 w4 B w1 a) Determine Boolean functions for intermediate outputs w,w2,w3, and w4 as well as the output signals X and Y. b) Construct a truth table showing the intermediate outputs wl,w2,w3, and w4 as well as the output signals X and Y c) Use K-maps to find simplified expressions...

  • Write a MATLAB script to generate a 512 × 512 test image consisting of a white...

    Write a MATLAB script to generate a 512 × 512 test image consisting of a white circle against a black background, use this image as an input to the fft2 function, and display the resulting spectrum. You should be able to notice the presence of “ringing” artifacts in the resulting spectrum, owing to the sharp transitions between the circle and the background. Andimplement the solution to the ringing artifact, while keeping the input image similar to the original (white circle...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT