CSCI 223 Quiz 3 Flashcards

1
Q

how to convert from decimal to hexadecimal

A

divide by 16, read the remainders from bottom to top

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

how to convert from decimal to binary

A

divide by 2, use the remainders from bottom to top (should be 0s and 1s)

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

how to convert from hexadecimal to decimal

A

label the positions from right to left as 0, 1, 2, … and multiply the number by 16^? and add the results together

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

how to convert from binary to decimal

A

label the positions from right to left as 0, 1, 2, … and multiply the number by 2^? and add the results together

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

how to convert from binary to hexadecimal or binary to hexadecimal

A

use the chart

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

0x0

A

0000

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

0x1

A

0001

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

0x2

A

0010

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

0x3

A

0011

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

0x4

A

0100

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

0x5

A

0101

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

0x6

A

0110

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

0x7

A

0111

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

0x8

A

1000

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

0x9

A

1001

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

0xA

17
Q

0xB

18
Q

0xC

19
Q

0xD

20
Q

0xE

21
Q

0xF

22
Q

Little Endian ordering

A

least significant byte (furthest to the right) has lowest address

23
Q

pointer

A

a variable whose content is a memory address

24
Q

how to declare a pointer

25
and chart
& 0 1 0 0 0 1 0 1
26
or chart
| 0 1 0 0 1 1 1 1
27
not chart
0 1 | ~ 1 0
28
exclusive or chart
^ 0 1 0 0 1 1 1 0
29
logical operations in C (logical and, logical or, logical not)
&&, ||, !
30
view zero as (true/false) and anything nonzero as (true/false)
false, true
31
for logical or, you want to place the more likely term to be (0 or 1) first
1
32
for logical and, you want to place the more likely term to be (0 or 1) first
0
33
left shift x << y will
shift bit-vector x left by y positions: throw away extra bits on left and will with 0's on the right; similar to multiplication by 2^x
34
right shift x >> y will
shift bit-vector x right by y positions; similar to division by power of 2
35
logical right shift
fill with zero's on the left
36
arithmetic right shift
replicate the most significant bit to the right on the left