100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Class notes

Class notes CMPUT229: StringsOfCharacters

Rating
-
Sold
-
Pages
20
Uploaded on
14-01-2021
Written in
2020/2021

Strings Of Characters











Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
January 14, 2021
Number of pages
20
Written in
2020/2021
Type
Class notes
Professor(s)
Jose nelson amaral
Contains
All classes

Content preview

Integers are 4 byles word 32bits
are 1 byte 8bits
Characters

doubles an 8
bytes 2words 64bits
Nullterminatingstring Asequenceof
characters endingwith 0 NULL




Topic V0E
Strings of Characters




1

, Instructions to Manipulate Characters Bytes
(Bytes)
AEfkBd
t.TT
RISC-V byte load/store instead of a word
String processing is a common case
lb t0, 0(s0)
lb t1, 1(s0)
lb rd, offset(rs1) Register Value
lbu t2, 0(s0)
s0 0x10001010
Sign-extend to 32 bits in rd lbu t3, 1(s0)
t0 0x00000009
t1 0xFFFFFF80

lbu rd, offset(rs1) t2 0x00000009
t3 0x00000080
Zero-extend to 32 bits in rd Address Value

unsigned 0x10001015 0x00
0x10001014 0x0B
sb rs2, offset(rs1)
0x10001013 0x00
Store just the rightmost byte 0x10001012 0x00

least significant 0x10001011
0x10001010
0x80
0x09




2

, Instructions to Manipulate Half words
In RISC-V a halfword is 16 bits

lh rd, offset(rs1)
Sign-extend to 32 bits in rd

lhu rd, offset(rs1)
Zero-extend to 32 bits in rd

sh rs2, offset(rs1)
Store just the rightmost halfword
least significant




3
CA$4.24
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
titaniayuki1

Also available in package deal

Thumbnail
Package deal
CMPUT229: full lesson
-
36 2021
CA$ 159.05 More info

Get to know the seller

Seller avatar
titaniayuki1 university of alberta
View profile
Follow You need to be logged in order to follow users or courses
Sold
2
Member since
4 year
Number of followers
1
Documents
69
Last sold
4 year ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

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

Frequently asked questions