Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1. To convert to base 10, first we multiply each digit by successive powers of 2, and
do the same thing but instead of using powers of 2 we use powers of 8 and 16
2. To convert to base 2, first we find the highest power of 2 that can be subtracted from
, which is actually or 8, which takes up the 4th digit in a base 2 system like so:
. For , it’s mostly the same process, the highest power of 2 is still 8, but there
is still a remainder of 2, which conveniently is also a factor of 2, which will take up the
2nd digit: . is also convenient because 16 is just , it will take up the 5th
digit:
3. The two’s complement is a way of expressing negative numbers in binary. How it works
is that a number in a base 2 system, will first have their bits negated (so 1 becomes 0, and
0 becomes 1), and then a 1 is added to the number. For we can calculate the two’s
complement
4. There are 8 bits in a byte. As text, each character in a word is a single byte, so
specifies single precision format, which doesn’t store floating point numbers. Those two
numbers are functionally the same in single precision format, so subtracting them is 0
6. “i=int8(4); j=int8(3); i/j” gives a result of 1, because “int” signifies an integer answer,
since there can’t be any decimals, they are rounded down, and 8/3=1.33 rounds to 1.
machines by compiling source code into something a computer can read, but interpreted
language requires the machine to directly parse the code and execute commands. A pro
about interpreted languages are that they’re easy to understand and analyze, but their
main drawback is that they are a lot slower than compiled languages.
matrices, which is why it’s called MATrix LABoratory. It can also be used to write
simple programs, and has a pretty friendly UI. The pros of MATLAB include the fact that
it’s easy to use and understand, and that it has a wide variety of practical applications.