notes

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 97caba2fa94b7460acade1e01b6a73f3007ac760
parent 8c6928132ac1579f6abb7509965f7ca0eb9f7bdb
Author: Andrew <andrewlaack1@gmail.com>
Date:   Sun, 19 May 2024 12:32:57 -0500

Added notes from yesterday

Diffstat:
MCS202.md | 2++
AOnesComplement.md | 9+++++++++
ATwosComplement.md | 18++++++++++++++++++
3 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/CS202.md b/CS202.md @@ -18,3 +18,5 @@ This is the index for my cs 202 notes. [[Lvalue.md]] [[SentinelValue.md]] [[CanaryValue.md]] +[[TwosComplement.md]] +[[OnesComplement.md]] diff --git a/OnesComplement.md b/OnesComplement.md @@ -0,0 +1,9 @@ +# One's complement + +Self Study + +## Notes + +**Definition:** One's complement is an implementation of signed values such that a 1 in the MSB position indicates the number is negative. + +This is not used today because it required extra computation for mathematical operations, and it has both a positive and a negative zero which is a waste. diff --git a/TwosComplement.md b/TwosComplement.md @@ -0,0 +1,18 @@ +:cs202: :computer-architecture: +# Two's Complement + +SS + +## Notes + +**Definition:** Two's complement is an implementation of negative numbers where a leading one and flipped bits are used to represent negative numbers. + +To do this calculation in either direction flip all bits and add 1. + +As such we have 1 and -1 as follows: + +1 : 00000001 + +-1 : 11111111 + +This solves the problem of having a negative zero and decreases the computational overhead of using [[OnesComplement.md]].