Look forward to hearing from your advisor to make an appointment early next week to discuss a draft of your requirements document.
Computers have changed a lot in the hardware details over the decades, yet they are still using a fundamental architecture that hasn't changed very much at all.
Which of the following is not part of a computer:
ALU
CPU
BLU
bus
RAM
clock
The clock does the following:
Determines the speed of the processor
Determines the speed of the memory
Sets the timestamp for files and network I/O
Synchronizes with GPS satellites
all of the above
It may be surprising, but we can create any number we want out of just two digits, zero and one. These two binary digits are called bits.
Essential to creating binary numbers is knowing your powers of two. You'll soon be able to create the following table quickly and reliably:
0 1 1 2 2 4 3 8 4 16 5 32 6 64 7 128 8 256 k 2k log2(n) n
The binary equivalent of 5 is
5
10000
110
101
The decimal equivalent of the binary number 1010 is
6
5
12
none of the above
Let's also try some of the following numbers:
There are some interesting observations to make about those numbers:
Once we have numbers, we can represent characters and text by simply numbering the characters.
leading zeros
What is 67 expressed as ASCII?
A
B
C
none of the above
What are 115 and 49 expressed as ASCII?
The fact that ASCII uses a limited number of bits has important implications. It can't represent an unbounded number of characters. This is true of all representations that use a limited number of bits.
Because of the way human vision works, we can represent pretty much any color using three primaries:
If we represent the amount of each with a number from 0-255.
Programmers use hex to have a convenient replacement for binary, because strings of bits are hard to read and hard to write. We will see that there is an easy way to convert binary to hex and vice versa. But first, we'll learn about hex as a number system, where is also finds use in programming.
In hex,
First, we'll count in hex up to 29.
The hex equivalent of 3710 is
37
45
47
none of the above
The hex equivalent of 9010 is
50
90
5A
none of the above
The decimal equivalent of BA16 is
186
180
190
none of the above
There's a nice match between colors being represented as 3 bytes and hex digits:
Earlier, we saw the numbers 67, 115, and 49 converted to ASCII. Converted to a color, they are:
#437331
#438331
#437349
none of the above
What does that color look like?
light red
dark green
light blue
none of the above
Colors can be represented as rectangular collections of spots of color called pixels. An image file comes in a variety of formats, some of which are uncompressed and some are compressed.
We will study the ideas behind one particular compressed format, namely GIF and touch on the others.
What is the approximate image size in bytes of an uncompressed image of 200 x 300 with 30 colors in it?
200 x 300 x 30
200 x 300 x 3
(200 x 300 x 3)/8
(200 x 300 x 30)/8
200 x 300 x 4
(200 x 300 x 4)/8
Indexed color depends crucially on the bit-depth, which is just another form of the relationship between the number of bits devoted to a representation and the number of different things you can represent.
What is the bit-depth of an image with 30 colors in it?
30
3
4
5
What is the approximate image size in bytes of an image of 200 x 300 with 30 colors in it, using indexed-color representation?
200 x 300 x 30
200 x 300 x 3
(200 x 300 x 3)/8 + 30 x 3
(200 x 300 x 30)/8
(200 x 300 x 5)/8 + 30 x 3
none of the above
What is the best image file format?
GIF
JPEG
PNG
none of the above
#437331