Skip to content

Conversation

@aabel14
Copy link

@aabel14 aabel14 commented Nov 18, 2025

First draft of number rep section, unsigned and signed

Copy link
Contributor

@lethalNeutrino lethalNeutrino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left mostly formatting issues with 1-2 content things that I have opinions on, but content is up to Lisa's discretion

format.
:::

4. How many numbers can be represented by an unsigned, base-4, $n$-digit number.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change . to ?

**C.**
:::

5. How many bits are needed to represent decimal number 116 in binary?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the decimal number and/or 116 -> $116_{10}$

5. How many bits are needed to represent decimal number 116 in binary?

::: {.callout-note title="Answer" collapse="true"}
**7 bits**. $(116)_{10} =$ `0b111 0100` or $log{_2}{116} \approx 6.85$ which we round to 7 bits.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log => $\log$


(a) We can write the value of an $n$-digit two's complement number as
$$
\sum_{i=0}^{n-2} 2^i d_i - 2^{n-1} d_{n-1}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use smth less confusing here like -2^n(d_n) + \sum... (same as unsigned but up to $n-1$? maybe i am just not understanding

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Propagate change to examples below too

$$
which is very similar to unsigned numbers.

(d) To negate a two's complement number: flip all the bits and add 1.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel like i would put an example here, but up to Lisa's discretion

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have an example from discussion slides that we use here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe so

## Precheck
If we have an $n$-digit unsigned numeral $d_{n-1}$ $d_{n-2}$...$d_0$ in radix (or base) $r$, then the value of that numeral is:
$$
\sum_{i=0}^{n-1} r^i d_i
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for example, but up to Lisa discretion

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have an example from discussion slides that we use here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CleanShot 2025-11-18 at 12 51 57@2x

@Rouxles Rouxles changed the title first draft num rep feat(num-rep): release Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants