Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 14 pages
Summary

Summary Machine Structure and Assembly Language Final Review

Document preview thumbnail
Preview 2 out of 14 pages

Comprehensive summary of all material covered in COMP 40 midterm and final exams. Condensed study guide.

Content preview

Midterm topics
storage of information
memories
· in
computer

memory
is addressed in
bytes y = 2xbit
choices
↳ encode numbers as bits
2 bits,


256) 10 11 0100 4 choices

assign every
char to a # Cup to




inherent meaning

symbols have no


information = bits + context



AMD-64 architecture

encodings of C
language types on



unsigned :
range is 0 to
(232-1)
(32 bits) most significant bit is


signed bit , remaining

11 31 bits
signed :
-



(231) to (23 preserve oneresign bits as normal


unsigned int


two zeros
disadvantage :

(+ 0/-0)




An
number
char
Complement : to negate a



short ① flip bits
0010 >
-
1101 >
-

1110
int
I
② add -

8+ 4 + 1= -
3
long


double
long long
float

~



floating-point representations

scientific notation (ish)

floating -
binary 118/23 1101 .
0101B + 1 1010161
-
.


23
sign bit exp significand
significand exponent
.




4 . 734 =
0100
3 n-bit binary pattern represents
0 75 x2
.
= 1 . 50 j
finite 2" distinct #S
00 1
0 50 x 2 = 1
from
.




floating point
.



↳ add As
0 75 + 0 11 to avoid loss
smallest- largest
.
.
>




4 is +
.




0lg . 11 +
1 0011X22-0011X2
.
of precision

add 127 to exp
: 0011x2129 011000000110011000000 ---0000

, contained
alignment every variable
↳ data
-

ensures will be

within single block of memory

① Add padding between the elements to ensure each element begins
at an offset that is a
multiple of their byte size




② Add padding to end of struct to ensure the struct itself is


a multiple of its
largest member
slooping thre an
array of structs,
each access has stride of 32 bytes)
-
structs size of (structs) =
32

double d; sized for



>
- structs a re

double e ; their worst-cased members

datatype always
load
a has
>
int Xi
an address that's a
float fi
multiple of its size
float ↑
g;
3
padding between struct
members maintains
alignment
Cessentially wasted space

↳ bit defines which
masking -
bits
you
want to keep
,
which bits want to clear
you
to value
:

apply mask


ANDing lextract subset of bits ORing (set subset of bits in

in value) a value
1100 0011 1100 0011 & = AND

1 =
OR


!
000 0
00 ~ = NOT




↳ bit shifting
Shift L, fill R w/O 3 shift R, fill I with

(both signed 1 (signed)/0 Consigned
0000 1101 and unsigned
b 1000 1101 /
3 + +2
00011010
x + X2 d

1) 100 0110

Document information

Uploaded on
March 26, 2025
Number of pages
14
Written in
2022/2023
Type
Summary
$5.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
4
Followers
0
Items
9
Last sold
8 months ago


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions