Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Exercise 2 (1 pt): Calculate 10000101012 multiplied by 3210 (without using a calculator), and
represent the result in integer binary.
Exercise 3 (1 pt): Calculate 110101112 divided by 51210 (without using a calculator), and
represent the result in integer binary.
Exercise 5 (1 pt): Multiply the following binary numbers, and express the product in binary:
10111010 1101
Exercise 6 (1 pt): Multiply the following binary numbers, and express the product in binary:
110101 11011
Exercise 7 (1 pt): Multiply the following binary numbers, and express the product in binary:
1110010111 10000000000
Exercise 8 (1 pt): Perform the following BINARY ADDITION and represent the result in integer
binary. (HINT: Do you really want to go through the unbelievable pain and agony of adding a
number to itself sixteen times? OMG!!! Imagine all the carries! Wait . . . hold on a moment . . .
hey, its the same number, repeated sixteen times! . . . ) (again, without using a calculator)
11111111
+11111111
+11111111
+11111111
+11111111
+11111111
+11111111
+11111111
+11111111
+11111111
+11111111
+11111111
+11111111
+11111111
+11111111
+11111111
I call 210, or 102410, the MAGIC NUMBER. I call it that because by memorizing the base ten
value for 210, youll be able to instantly recall it when needed. Furthermore, youll then be
capable of rapidly calculating the base ten values of other, nearby powers of 2with ease! For
example, 211 is just two times 210. So 211 equals 204810. Similarly, 212 is just two times 211. So 212
equals 409610. Etc.
Exercise 9 (1 pt): How many different combinations of 1 and 0 are possible using 13 bits?
(express your answer in base ten) (Were you thinking about using a calculator? Dont.)
Exercise 10 (1 pt total): What is the largest possible positive, base 10 integer that can be
represented using 13 bits?
(a) (0.5 pt) Write the answer in base ten; and then
(b) (0.5 pt) Write the answer in binary.
Exercise 11 (1 pt): What is the minimum number of bits required to write the base ten number
3,357 in binary? (NOTE: In binary numbers, individual 1s and 0s are called bits. And so, the
binary number 101101 is comprised of six bits, or, is referred to as a six bit binary number)
PROGRAM B:
a = 1;
b = a - 3;
a
b
b = a - 3;
a = 1;
a
b
When PROGRAM A is executed in Matlab (statements execute in order, from top to bottom),
values for a and b are printed to the command console, but when PROGRAM B is executed
(again, from top to bottom) in Matlab, an error results. Explain why.
Exercise 13 (1 pt):
What output results when the following Matlab program executes (in
order, from top to bottom)?
a
b
c
d
=
=
=
=
1
3;
2*a - 3*b;
c^2
Exercise 14 (1 pt):
What output results when the following Matlab program executes (in
order, from top to bottom)? (HINT: pi is an INTRINSIC I.E., BUILT-IN MATLAB CONSTANT)
a
b
c
d
=
=
=
=
cos(pi);
sin(pi/2);
2*a*b - 3;
a - b + c*c*c
Exercise 15 (2 pts):
What output results when the following Matlab program executes (in
order, from top to bottom)? (HINT: Remember the ORDER OF OPERATIONS)
a
a
b
c
d
=
=
=
=
=
(1 + 2 - 3*4 - 1)/5
((a + a)*a)/a
-1*a/4
b^3 - 4
a - b + c*c*c
Exercise 16 (2 pts):
What output results when the following Matlab program executes (in
order, from top to bottom)?
a = 2^3;
b = cos(0);
c = abs(sqrt(16));
d = a*c - b*c;
d1 = a;
d2 = d;
d3 = d1 - d2 + d*2*(d1/c)
Where: Y is a variable assigned the value of the height (in meters) of the object above the
Earths surface; t is a variable assigned the value of the elapsed time (in seconds); g is a variable
assigned the value of the Earths constant acceleration due to gravity (in meters per second2), v
is a variable assigned the value of the objects initial velocity (in meters per second), and h is a
variable assigned the objects initial height above the Earths surface (in meters).
PROBLEM:
A small object is released at an initial height above the Earths surface of h = 935.0 meters. Its
initial velocity is v = -18.0 meters per second, and the Earths acceleration due to gravity is g =
9.81 meters per second2. What is the height of this object above the Earths surface after one
second has elapsed? After three seconds have elapsed? After eight seconds have elapsed?
How many seconds will elapse before the object hits the surface of the Earth? (NOTE: The
object hits the surface of the Earth when Y = 0.0 meters. You dont have to obtain Y = 0.0
exactly, just get close enough, where close enough means within 2.0 meters. In other words,
keep varying t, running your program each time you do, until you obtain a final value for Y that
is between 2.0 meters and -2.0 meters. The corresponding value of t that produced this final
value for Y, is the answer youre looking for.)
NOTE:
You will need to translate the above equation into CORRECT MATLAB SYNTAX so that your
program will run. Meaning: if you write vt , hoping that Matlab will figure out that you really
meant to write v*t , well, youre asking too much because Matlab aint that smart! And so
you will get an error if you do this.