CDS-130/06 SPRING 2018: HOMEWORK ASSIGNMENT #4
ASSIGNED 12 FEBRUARY 2018, DUE 19 FEBRUARY 2018,
NO LATER THAN 7:40PM, IN CLASS, AND IN HARDCOPY
EXTENDED BINARY TEMPLATE EXERCISES
PLEASE READ “The Extended Binary Template”, LOCATED IN THE CLASS 4 FOLDER ON
BLACKBOARD. YOU MUST READ THIS HANDOUT BEFORE COMPLETING THE FOLLOWING THREE
EXERCISES:
Exercise 1 (1 pt.): Convert 111001.1112 to base ten using the extended binary template. Please
write your answer in base ten.
Exercise 2 (1 pt.): Convert 1101011.01112 to base ten using the extended binary template.
Please write your answer in base ten.
Exercise 3 (1 pt.): Convert 97.3310 to floating point binary, using the extended binary template.
Please write your answer in floating point binary.
NOTE: IF ANY OF THE ABOVE ANSWERS EXTEND BEYOND THE FOURTH BINARY POINT, THE
TRUNCATE (DO NOT ROUND) AT THE FOURTH BINARY POINT. E.G.: 101.111010101 BECOMES
101.1110 . SIMILARLY, IF ANY OF THE ABOVE ANSWERS EXTEND BEYOND THE FOURTH
DECIMAL POINT, THE TRUNCATE (DO NOT ROUND) AT THE FOURTH DECIMAL POINT. E.G.:
33.123456789 BECOMES 33.1234
LEFT AND RIGHT BIT PATTERN SHIFT EXERCISES
PLEASE REVIEW LEFT AND RIGHT BIT PATTERN SHIFTS BEFORE COMPLETING THE FOLLOWING
THREE EXERCISES:
Exercise 4 (1 pt.): Start with the following 32 bit pattern stored in memory. Call this “Bit Pattern
A”:
1110 1110 1001 0101 1111 1011 0101 1111
Now execute 19 LEFT SHIFTS ON BIT PATTERN A, TO PRODUCE BIT PATTERN B.
Next, execute 22 RIGHT SHIFTS ON BIT PATTERN B, TO PRODUCE BIT PATTERN C
Finally, write out Bit Pattern C, using the full 32 bits:
CDS-130/06 SPRING 2018: HOMEWORK ASSIGNMENT #4
ASSIGNED 12 FEBRUARY 2018, DUE 19 FEBRUARY 2018,
NO LATER THAN 7:40PM, IN CLASS, AND IN HARDCOPY
Exercise 5 (1 pt.): Start with the following 32 bit pattern stored in memory. Call this “Bit Pattern
D”:
1111 0100 1110 0111 1010 0001 1000 1111
Now execute 17 LEFT SHIFTS ON BIT PATTERN D, TO PRODUCE BIT PATTERN E.
Next, execute and additional 9 LEFT SHIFTS ON BIT PATTERN E, TO PRODUCE BIT PATTERN F
Then, execute 7 RIGHT SHIFTS ON BIT PATTERN F, TO PRODUCE BIT PATTERN G
Finally, write out Bit Pattern G, using the full 32 bits:
Exercise 6 (1 pt.): Write out the 32 bit representation of the largest possible positive integer
that can be represented with 30 bits.
MATLAB MATRIX SYNTAX EXERCISES
While it’s possible to simply key the following Matlab programs directly into Matlab, run them,
and produce output (either clean output, or red error messages), DO NOT DO THAT. Why,
you ask? Because you’ll encounter problems like these on future quizzes and exams. Since you
won’t be permitted to use Matlab on quizzes and exams, you may suddenly find yourself unable
to cope with quiz and exam problems, if you haven’t developed the ability to do these Matlab
syntax exercises by hand! So it’s much better to get the practice you need now (when you have
time to spare), rather than later, when time is a very precious commodity.
Exercise 7 (1 pt.): Predict the output that appears in Matlab’s command window when the
following Matlab program is run (YOU MUST SHOW SOME WORK TO RECEIVE FULL CREDIT!):
CDS-130/06 SPRING 2018: HOMEWORK ASSIGNMENT #4
ASSIGNED 12 FEBRUARY 2018, DUE 19 FEBRUARY 2018,
NO LATER THAN 7:40PM, IN CLASS, AND IN HARDCOPY
Exercise 8 (1 pt.): Predict the output that appears in Matlab’s command window when the
following Matlab program is run (YOU MUST SHOW SOME WORK TO RECEIVE FULL CREDIT!):
Exercise 9 (1 pt.): Predict the output that appears in Matlab’s command window when the
following Matlab program is run (YOU MUST SHOW SOME WORK TO RECEIVE FULL CREDIT!):
Exercise 10 (1 pt.): Predict the output that appears in Matlab’s command window when the
following Matlab program is run (YOU MUST SHOW SOME WORK TO RECEIVE FULL CREDIT!):
CDS-130/06 SPRING 2018: HOMEWORK ASSIGNMENT #4
ASSIGNED 12 FEBRUARY 2018, DUE 19 FEBRUARY 2018,
NO LATER THAN 7:40PM, IN CLASS, AND IN HARDCOPY
MATLAB FOR LOOP SYNTAX EXERCISES
While it’s possible to key the following Matlab programs directly into Matlab, run them, and
produce output (either clean output, or red error messages), DO NOT DO THAT. Why, you
ask? Because you’ll encounter problems like these on future quizzes and exams. Since you won’t
be permitted to use Matlab on quizzes and exams, you may suddenly find yourself unable to cope
with quiz and exam problems, if you haven’t developed the ability to do these Matlab syntax
exercises by hand! So it’s much better to get the practice you need now (when you have time to
spare), rather than later, when time is a very precious commodity.
Exercise 11 (2 pts.): Predict the output that appears in Matlab’s command window when the
following Matlab program is run (YOU MUST SHOW SOME WORK TO RECEIVE FULL CREDIT!):
Exercise 12 (2 pts.): Predict the output that appears in Matlab’s command window when the
following Matlab program is run (YOU MUST SHOW SOME WORK TO RECEIVE FULL CREDIT!):
CDS-130/06 SPRING 2018: HOMEWORK ASSIGNMENT #4
ASSIGNED 12 FEBRUARY 2018, DUE 19 FEBRUARY 2018,
NO LATER THAN 7:40PM, IN CLASS, AND IN HARDCOPY
Exercise 13 (2 pts.): Predict the output that appears in Matlab’s command window when the
following Matlab program is run (YOU MUST SHOW SOME WORK TO RECEIVE FULL CREDIT!):
CDS-130/06 SPRING 2018: HOMEWORK ASSIGNMENT #4
ASSIGNED 12 FEBRUARY 2018, DUE 19 FEBRUARY 2018,
NO LATER THAN 7:40PM, IN CLASS, AND IN HARDCOPY
MATLAB PROGRAMMING EXERCISE: CHEMICAL REACTION KINETICS
NOTE: IN THIS MATLAB PROGRAMMING EXERCISE, WRITE
THE PROGRAM FIRST BY
HAND, ON PAPER (PART 1).
THEN KEY YOUR PROGRAM INTO MATLAB, AND RUN IT
TO PRODUCE THE REQUIRED OUTPUT IN THE BELOW TABLE (PART 2). “WORK” FOR THIS
EXERCISE WILL CONSIST OF YOUR HANDWRITTEN PROGRAM AND A SCREENSHOT OF YOUR
PROGRAM IN MATLAB THAT SHOWS OUTPUT FOR ONE ROW OF THE TABLE PRODUCED BY
YOUR PROGRAM WHEN RUN.
Exercise 14 (From Chemistry; 4 pts.) Molecule A decomposes to form either product molecule B
or product molecule C. The concentrations of B and C over time are given by the following
equations:
𝐶𝑜𝑛𝑐𝐵 =
𝑘1
(𝐶𝑜𝑛𝑐𝐴0 )( 1.0 − 𝑒 −(𝑘1 +𝑘2 )𝑡 )
𝑘1 + 𝑘2
𝐶𝑜𝑛𝑐𝐶 =
𝑘2
(𝐶𝑜𝑛𝑐𝐴0 )( 1.0 − 𝑒 −(𝑘1 +𝑘2)𝑡 )
𝑘1 + 𝑘2
Where:
ConcB is the concentration of molecule B, as a function of time t (units: mol dm-1)
ConcC is the concentration of molecule C, as a function of time t (units: mol dm-1)
k1 is the first order rate constant for the unimolecular reaction A B (units: s-1)
k2 is the first order rate constant for the unimolecular reaction A C (units: s-1)
ConcA0 is the initial concentration of A (units: mol dm-1)
t is time (units: s)
(CONTINUED ON NEXT PAGE)
CDS-130/06 SPRING 2018: HOMEWORK ASSIGNMENT #4
ASSIGNED 12 FEBRUARY 2018, DUE 19 FEBRUARY 2018,
NO LATER THAN 7:40PM, IN CLASS, AND IN HARDCOPY
Write a Matlab program to compute the concentrations of B and C over time, as required in the
following table:
ConcBt
ConcCt
k1
300
300
250
250
150
75
k2
100
100
200
200
275
300
ConcA0
2
2
3
4
5
6
t
1.0e-03
0.1
1.0e-04
1.0e-03
1.5
1.0e-04
READING ASSIGNMENT:
1. PLEASE FINISH READING CHAPTERS 5, 6, 7 AND 8 IN THE
“INTRODUCTION TO MATLAB” PRESENTATION.
2. PLEASE BEGIN READING CHAPTER 9 IN THE
“INTRODUCTION TO MATLAB” PRESENTATION.
Purchase answer to see full
attachment