Question
IN MATLAB. For converting from decimal to binary (or binary to decimal), only concern yourselves with numbers only to the left of the decimal or
IN MATLAB. For converting from decimal to binary (or binary to decimal), only concern yourselves with numbers only to the left of the decimal or numbers only to the right. For example, have code written to convert 17 to binary and 0.25 to binary but dont worry about converting 17.25 to binary. Both cases (numbers only to the left or only to the right of the decimal) need to be included in each code for parts 1 and 2. However, be sure to convert any type of number from decimal to IEEE-754 format. Utilize loops (for and while) and if-else constructs. Test your code for #1 on the following numbers: 9, 43, 107, 1003, 0.875 Test your code for #2 on the following numbers: 10001, 0.1011, 111001111, 0.1101101 Test your code for #3 on the following numbers: 36, 0.875, 120 Extra Credit: Write code to account for a repeating segment when converting from decimal to binary. Test your code on 0.68 and 0.4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started