Question: first image is the twoscomplement.m file clear; clc; x=-28; if (x>=0) y=dec2bin(x,6); else y=; end 1. MATLAB The way to compute 2's complement of a

first image is the twoscomplement.m file  first image is the twoscomplement.m file clear; clc; x=-28; if (x>=0)
y=dec2bin(x,6); else y=; end 1. MATLAB The way to compute 2's complement

clear; clc; x=-28; if (x>=0) y=dec2bin(x,6); else y=; end 1. MATLAB The way to compute 2's complement of a negative number 2's Complement: N* = 21-N Ex: - 510 = 24 - 5 = 16 - 5 = 1110 = 1011, MATLAB decimal to binary, "dec2bin() Complete line 7 in twoscomplement.m. Given a decimal integer (either positive or negative), it can be converted into 2's complement binary number. The integer has 6 digits (n=6). Then run it to test if-28 is converted correctly. 2. MATLAB Simulink 2.1 Use one Pulse Generator and one scope. Show the clock signal in the scope. (Sample based, Amplitude=1, Period=2, Pulse width=1, Phase delay=1, Sample time=1). 2.2 Design the binary code for 16 decimal number (0-15) Binary Code Decimal ABCD S S SS 0 0 0 0 0 1 0 0 0 1 2 3 0 0 1 1 0 1 0 0 5 0 1 0 1 6 0 1 1 0 7 6 1 0 0 0 9 1 001 10 11 12 1 1 0 0 13 1 1 0 1 1 Use four pulse generators and one scope to simulate the BCD codes. The waveform should show each of the binary code in the correct order

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!