Midterm (2) Flashcards

1
Q

How many bits are there in a “byte” of data?

A

8 bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a popular convention set that associates 8 bit binary bit patterns to different characters?

A

ASCII

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Is it reasonable to store an ASCII character value in a byte?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the CPU do?

A

Runs programs and makes sure the computer runs smoothly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What size of memory is the least amount that has an address/name that machine code can refer to?

A

8 bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What size of memory does a computer typically use to store an integer for floating point value?

A

A “word” of memory, either 4 bits (float) or 8 bits (double)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

True or False: Two common word sizes are 32 and 64 bits, and larger word size allows for greater precision and greater range for values stored.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a string in Python?

A

One or more characters placed in a sequence to be an “ASCII text” string, or just “string” for short.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the process of converting a float in string form to a binary floating point number used by the CPU to do math?

A

Casting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the one type of language a CPU can perform?

A

Machine Code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

True or False: A variable can be thought of as a name which points to a value.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Given that the 8 bit pattern 00110100 is the ASCII representation for the character “4”, and assuming we have a computer with only 8 bit words, what would the memory X points at look like if we executed the statement X = input(“type in an int”) and the user entered a 4 and then pressed enter?

A

00110100
(because they’re entering the string for the character 4, not the integer 4)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What would the machine code representation of the number 4 look like if it were entered as a string, then cast as an in int?

A

00000100
(The integer value of 4 expressed in binary machine code)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What happens to a value in memory if things change and there is no variable pointing to it anymore?

A

It gets garbage collected and allocated to free/unused memory by Python

How well did you know this?
1
Not at all
2
3
4
5
Perfectly