Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

cse 30 practice final (written) - spring 2026 practice final disclaimer…

Question

cse 30 practice final (written) - spring 2026

practice final disclaimer: this practice final is not in any way a representation of the actual final exam. it is intended solely to cover topics that are fair game on the final. the format, length, and types of questions on the actual final are not guaranteed to match this practice exam.

  1. calculate the following numerical conversions.

a) convert the decimal value -29 to its 6-bit twos complement representation.
show your work for possible partial credit

b) convert the 6-bit twos complement value 11011 to its decimal representation.
show your work for possible partial credit

  1. consider the following c code. the base address of arr is 0x0000c100. after the code is run, what is the value of ptr in hexadecimal?

int arr32 = {{10, 20}, {30, 40}, {50, 60}};
int *ptr = &arr20;

ans as a hexadecimal:

Explanation:

Convert -29 to 6-bit Two's Complement

$$ LATEXBLOCK0 $$

Convert 6-bit Two's Complement 110111 to Decimal

$$ LATEXBLOCK1 $$

Calculate the value of ptr in hexadecimal

$$ LATEXBLOCK2 $$

Answer:

Question 1a

The 6-bit Two's Complement representation of -29 is:

$$ 100011_2 $$

Question 1b

The decimal representation of the 6-bit Two's Complement value 110111 is:

$$ -9 $$

(Note: If the question meant the 5-bit value 11011 as written in the text, the decimal value is \(-5\).)

Question 2

The value of \texttt{ptr} in hexadecimal is:

$$ \texttt{0x0000c110} $$