CPSC-2310 Exam 2 Fall 2025

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/25

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

26 Terms

1
New cards

size of data type char in bytes

1 byte

2
New cards

size of data type short in bytes

2 bytes

3
New cards

size of data type int in bytes

4 bytes

4
New cards

size of data type long in bytes

8 bytes

5
New cards

size of data type char* in bytes

8 bytes

6
New cards

Little endian

least significant byte to the most significant byte

7
New cards

Big endian

Most significant byte to the least significant byte.

8
New cards

What happens to the equivalent hexadecimal value of 2n as n increases by 4?

The hexadecimal value is multiplied by 10. (e.g. 24 = 0x10, 28 = 0x100, 212 = 0x1000)

9
New cards

Rule for Bitwise (~) NOT

flip each bit. (0→1, 1→0)

10
New cards

Rule for Bitwise (&) AND

If both bits are 1, the resulting bit will be 1, otherwise 0.

11
New cards

Rule for Bitwise (^) EXCLUSIVE OR (XOR)

If both are the same you get a 0. If different you get a 1.

12
New cards

Rule for Bitwise (|) OR

1 if either bit is 1.

13
New cards

Use bitwise ________ to extract a subset of the bits in a value.

AND

14
New cards

Use bitwise ________ to set a subset of bits in a string of bits.

OR

15
New cards

Use bitwise ________ to toggle a subset of bits in a string of bits.

XOR

16
New cards

The Left Shift Operator is a binary operator that is the equivalent to ________ the bit pattern with 2k (assuming shift k bits to the left).

multiplying.

17
New cards

The Right Shift Operator is a binary operator that is the equivalent to ________ the bit pattern with 2k (assuming shift k bits to the right).

dividing

18
New cards

The difference between logical right shift and arithmetic right shift.

Logical shift shifts in zeros (used for unsigned). Arithmetic shifts replicates the sign bit (used for signed integers).

19
New cards

True or False: Unsigned data always uses logical right shift

TRUE

20
New cards

Signed Magnitude

Flip the first bit (sign bit): 0 = positive, 1 = negative. EX: -5 → 10000101, +5 → 00000101.

21
New cards

2’s Complement

Invert all bits, then add 1.

22
New cards

1’s Complement

Invert all bits

23
New cards

116 in binary

0001

24
New cards

216 in binary

0010

25
New cards

416 in binary 

0100

26
New cards

816 in binary

1000