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

A

1010

17
Q

0xB

A

1011

18
Q

0xC

A

1100

19
Q

0xD

A

1101

20
Q

0xE

A

1110

21
Q

0xF

A

1111

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

A

int *p;

25
Q

and chart

A

& 0 1
0 0 0
1 0 1

26
Q

or chart

A

0 1
0 0 1
1 1 1

27
Q

not chart

A

0 1

~ 1 0

28
Q

exclusive or chart

A

^ 0 1
0 0 1
1 1 0

29
Q

logical operations in C (logical and, logical or, logical not)

A

&&, ||, !

30
Q

view zero as (true/false) and anything nonzero as (true/false)

A

false, true

31
Q

for logical or, you want to place the more likely term to be (0 or 1) first

A

1

32
Q

for logical and, you want to place the more likely term to be (0 or 1) first

A

0

33
Q

left shift x &laquo_space;y will

A

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
Q

right shift x&raquo_space; y will

A

shift bit-vector x right by y positions; similar to division by power of 2

35
Q

logical right shift

A

fill with zero’s on the left

36
Q

arithmetic right shift

A

replicate the most significant bit to the right on the left