Ece 2071
Ece 2071
Week 2
re
viet
vida qto.mg néu San
← written function -
k
Static variable
L
give nguyén qua cat
⊕ lair 1-
~
a = b
⊕ 1Eur 2 I
a = a + b = Za
static
loin tmÉc
4 5878 9
0 I 23
2°
'
23 22 2
hear = is
8 4 2 I 2 / °
.
16 16 16
. .
. .
.ie before : Junk
-
. _
.
20-323 int
- . . 24 → 27 char :/ bit
8
28 qg
µ
0×62 -
① vi bat doin hi . . .
.
20 → Ic < 20 → Junk
( out of scope )
② .
.
20 : int ( 98 ) rien chitin 4 bits
Di 98 → he × → 62 → 0×62
( dec )
③ Éibary
"
d-
"
. . .
29 : ECE →
ASCII
95/43-45 → 0 ✗
95434500¢end
line ( lo )
② _ . .
28 : int CO2) d-of dec → hex
2 1 16 = 0 Cdu' 2) → 0×2
⑤ . . .
2C : mft int = 4 bits → 28 29 Za 2b
= 0 Chex to dec )
⑥ . . .
30 :
int (0×0) = 4 bits = 2C 2d Ze 2f
(0×31^0×2)
⑦ . . .
34 :
hiong Hi ,
int
✓
#
0011 0010
0011
0001 → 0×1
0010 -
¥
Chi I khi 2 Cai Khai nhan
Week 7 quiz
prews
④ concept questions
112,3
[ load word
bits 3 32×3=96
I register = 32 =
instruction
storeinfo-instmch.com#
-
accordingtoinslmctionu.it
trout
by
need of step
- -
step change
-
parts of computer :
CPU out instructions that are stored in the
:
carry memory
11
core
"
"
L interact with 2
higher-level blocks
task depends
① datapath : production line ,
doing on
> of different
decide instruction ( in
assembly ) Made
(
on .
up
operate data
firs units to on .
< for
register = short -
term
memory data path to
while instruction
brain access performing .
② Tonto 1 unit :
sending signal to components to
to handle instruction ,
which steps
?⃝
⑤ Memory : where data stored . Data path access this
for information if
necessary
( IO ) =
Inputs/ Outputs : how computer interact with
outside world .
CPU )
Input gain information from outside world ( outside
-
internet
-
MEPS
assembly language link between high level
language
-
-
:
,
✗ machine code .
of instructions
⊕ 3
types ,
32 bits each : I, J ,
R
T
details below
⊕ an example of code :
of instruction
Types
-
R -
[ structure rt func
:
opcode rs rs
6 5 5 6 ( bits )
5
I -
tri
n
-
bits =
Chay
' -1
2n 2h
-
-
→ -1
J -
¥ .
cannot jump AND branch at the same time
[ structure :
opcode immediate
6 26 ( bits )
Caéh d-Éi R/I / I
type →
binary
representation
signal ≤ m=
☐
Control register
of RAM >
array
. . .
1 I R
Reg Dst =
type =O type
-
-
-
:
,
1 I 0 R
ALU src
type type
= -
= -
:
-
-
Mem to Reg :
write
Reg :
-
-
Mem Write :
only 1 for SW
-
Branch :
ALUOP : -
1 :
¥ By default , everything is 0
✗ if mem Write
rnem Read =
0 everything = 0
write
reg
when
changing
a
modifying bit
¥ difference between lw ,
hi
,
lb :
immediate 42 )
-
Ii : load an value
Ceg : ti $ to ,
location
memory .
④ eg : he $+0 ,
0 ( $ so ) = load word from
extended it to 32 bits
sign
-
( $ so ) with but
⊕ eg : lb $+0 ,
8 : same 1W
only
a byte
$+0 $+1 label
beg
:
beg , ,
J%f3.es
20
Linh nai to : 0×29
. _ . _ m&t
label . . . .
0.x 30
immediately =
0×30-0×2 , =3
else → K branch
d-É k waste 2
shift left
zeros
- 2
Cvinhay 9--0100-7 \ -
_
-
most
t
signif.ca# PC [31-28]
bits
"
I → jump
jump
-
-
31 bits →
-
pipelining :
%ML
info of
simultaneously load
update ↑
In order successor
root ré Phai
'
t
root nhat
ré trai d-É
goin
to
riay
'
come from ) ↓
point parent to NULL
* atoi =
sting to
integer
" "
11 → 11
PLC
Week 8 ws flux
① 11 in
binary :
24 2°
'
25 23 22 2
0 0 I 0 I 1
= 8 + 2 + I = 1
② -11 in
binary
bit
⊕ turn least
significant to 1 : 110101
③ 10110 t 10011 = ?
→
carry
10110 I + I = 0 ( I
carry
+
10011 to next Col )
I 01001 ✓ Ot 0 = 0
I t 0 = 0 + I =
I
④ 10110 = ?
( flip
everything & add 1)
I 0110
ioiio
100 11
-
= 10110 1- 0110 I
01 1 01
00011 = 11 ✓
✗ 00011 ✓ i
the overflow ( most of the case )
ignore
?⃝
?⃝
⑤ perform the
following ,
what happen ?
or $ -12
, $-11 ,
$ to
(
0×6 LO ✗ C
1 1 00
0
⑤ → 1 1 10 → 8+4+2+0
Oil
= 14 Chexa ) ✓
Sll $ rd ,
$ rt ,
shift Amount
Srt $ rd ,
$ rt ,
shift Amount
left
→
shifting a
binary by 3 =
2×2×2
←
# of step = 23 = 8 ✓
shift left = 23
Week 8
pre
-
ws quiz
1954 . 1239
-
T ( number
whole number
decimal
portion portion
1954 12 997 0
997 12 988 I
488 12 294 0
1954=1111 0100010
24912 122 0
12212 61 0
6112 30 1
3012 15 0
1512 7 1
712 3 I
312 I 1
1 12
⑤ I
0.1234×2 0.2468 0
0.1234
0.2468 ✗ 2 0.9936 0
= 0001
0.9936×2 0.9872 0
0.9872×2 1.9799 I
③ combine :
¥ '"É◦◦o
' '
,
1111 0100010
\ /
1111 0100 010 .
0001
"
decimal point form where steps
④ move to i. abed ✗ 2 =
§
'
=) 1111 0100 010
t.jo#
.
0001 = 0001 ✗ 2
10
steps used to
⑤ determine the
sign find exponent
/ = ⊖ 0 = ⊕ 1954 . 1234 = ⊕
,
,
sign = 0
⑥ find exponent (
single precision)
(double precision -_ 1023 )
127
single → exponent bias =
'7 8 1
10001001
:
exponent = 127 +10 = 137
137 -
binary
137
68
68
34
17
0
◦
1
: :
a
≥
2
'
0
34
⑦ Compile all the part
I
i.IE/iE?aio
- - / \
result
two complement
10
-
I 000
1010--1010
' =
sign bit ,
I means ⊖
-
10
0×23 =
'
00T
'
= 2° + 2
'
+ 25 = 35
hex a
binary decimal
he ✗ a value
→ this is
to decimal
have to change
9 bits
I
jump =
[
101µg
8 9
]
. . .
[4 67
[0 I 23 ] 5
- -
Week 9 prews quiz
0×0000 0080
I
bit:O
TT
least sig
kéo _dÉn muÉn
doii least
Sig bit d-§ dai
mong
0 0 0 0 r-i.l0 0 0 32bitsd.ua
=3
theo
being nñy
I.
Week 10 prews quiz
-
assert = set to 1
-
on
-
Data path (
everything )
-
ALU op [ 0] ,
[I ] = 2 bits ( how can 3 bits )
C. for ? )
eg , beg
-
Lw ,
Sw ,
1b ,
Sb
-
$sp ( stack
pointer )
Week 11 pre
-
ws