|
|
|
lecture02 Manorathan Indran s conflicted copy 2012-02-07 Muk...
lecture02_Manorathan_Indran_s_conflicted_copy_2012-02-07_Mukul_Patel_s_conflicted_copy_2012-03-20.ppt
Showing 17-22 out of 28
lecture02 Manorathan Indran s conflicted copy 2012...
lecture02_Manorathan_Indran_s_conflicted_copy_2012-02-07_Mukul_Patel_s_conflicted_copy_2012-03-20.ppt-Jie Hu, ECE/NJIT, Spring 2011 ECE252
lecture02 Manorathan Indran s confl...
lecture02_Manorathan_Indran_s_conflicted_copy_2012-02-07_Mukul_Patel_s_conflicted_copy_2012-03-20.ppt-Jie Hu, ECE/NJIT, Spring 2011 ECE252
Page 17
Jie Hu, ECE/NJIT, Spring 2011
ECE252 L02-68000 Arch.17
Endianness: Example
Register value (.L): 0XBDC3A827
0x00..00
0xffffffff
0x00..10
0x00..13
27
A8
C3
BD
0
1
2
3
27
A8
C3
BD
0x00..00
0x00..10
0x00..13
0xffffffff
27
A8
C3
BD
Big Endian
Little Endian
0
31
bit
byte
Page 18
Jie Hu, ECE/NJIT, Spring 2011
ECE252 L02-68000 Arch.18
Number Systems (Review)
Positional number system representation (unsigned):
where
n
is the number of digits,
r
is the radix or base,
and
a
i
are the digits (coefficients),
0 <=
a
i
<
r
Based on the value of the radix
r
, we have
decimal:
r
=10,
a
i
:0,1,2,3,4,5,6.7,8,9
binary:
r
=2,
a
i
:0,1
octal:
r
=8,
a
i
:0,1,2,3,4,5,6.7
hexadecimal:
r
=16,
a
i
:0,1,2,3,4,5,6.7,8,9,A,B,C,D,E,F
In 68000 assembly code, numbers can be either in decimal
(e.g, 91) or hexadecimal (e.g, $5B)
0
1
2
2
2
2
1
...
1
a
r
a
r
a
r
a
r
a
N
n
n
n
n
Page 19
Jie Hu, ECE/NJIT, Spring 2011
ECE252 L02-68000 Arch.19
Base Conversion
From binary/octal/hexadecimal to decimal, use the
representation equation to evaluate
101111
2
=1x2
5
+0x2
4
+1x2
3
+1x2
2
+1x2+1=47
10
1352
8
=1x8
3
+3x8
2
+5x8+2=746
10
2EA
16
=2x16
2
+14x16+10=746
10
Convert decimal to binary
105
10
=(?)
2
105
10
=(1101001)
2
Convert decimal to octal?
105
10
=(?)
8
Convert decimal to hexadecimal?
105
10
=(?)
16
105
2
52
1
2
26
0
2
13
0
2
6
1
2
3
0
2
1
1
2
0
1
Page 20
Jie Hu, ECE/NJIT, Spring 2011
ECE252 L02-68000 Arch.20
Base Conversion
Base conversion among binary, octal, and hexadecimal
binary
octal
1100100101
binary
hexadecimal
1100100101
octal
hexadecimal
001 100 100 101
1
4
4
5
1445
8
0011 0010 0101
3
2
5
325
16
1445
8
001 100 100 101
1
4
4
5
0011 0010 0101
3
2
5
325
16
Page 21
Jie Hu, ECE/NJIT, Spring 2011
ECE252 L02-68000 Arch.21
Signed Binary Representations
Signed-Magnitude Representation
Sign-bit (MSB) indicates a positive (Sign:0) or a negative (Sign:1)
number
the Remaining bits represent the (unsigned) value
e.g., (105)
10
=(0 1101001)
2
, (-105)
10
=(1 1101001)
2
what about (0)
10
= (?)
2
?
(+0)
10
= (0 0000000)
2
, (-0)
10
= (1 0000000)
2
1’s-Complement Representation
Positive number same as in signed-magnitude representation
Derive negative number representation by bit-complementing its
positive representation
e.g., (105)
10
=(0 1101001)
2
, (-105)
10
=(1 0010110)
2
What about (0)
10
?
(+0)
10
= (0 0000000)
2
, (-0)
10
= (1 1111111)
2
Page 22
Jie Hu, ECE/NJIT, Spring 2011
ECE252 L02-68000 Arch.22
Signed Binary Representations
2’s-Complement Representation
Positive number same as in signed-magnitude representation
Derive negative number representation by bit-complementing its
positive representation (x) and
adding
1
to its least significant bit,
i.e., 2
k
– x, where k is the number of bits of the representation
e.g., (105)
10
=(0 1101001)
2
,
e.g., (-105)
10
=(1 0010110 + 1)
2
=(1 0010111)
2
What about (0)
10
?
(+0)
10
= (0 0000000)
2
, (-0)
10
= (1 1111111 + 1)
2
= (0 0000000)
2
What is (1 0000000)
2
=(?)
10
(1 0000000)
2
=(-128)
10
Data range: [-2
k-1
, 2
k-1
-1], for k-bit number representation
68000 uses 2’s-complement representation
Ace your assessments! Get Better Grades
Browse thousands of Study Materials & Solutions from your Favorite Schools
New Jersey Institute of T...
New_Jersey_Institute_of_Technology
School:
Microprocessors
Course:
Introducing Study Plan
Using AI Tools to Help you understand and remember your course concepts better and faster than any other resource.
Find the best videos to learn every concept in that course from Youtube and Tiktok without searching.
Save All Relavent Videos & Materials and access anytime and anywhere
Prepare Smart and Guarantee better grades
Students also viewed documents
lab 18.docx
lab_18.docx
Course
Course
3
Module5QuizSTA2023.d...
Module5QuizSTA2023.docx.docx
Course
Course
10
Week 7 Test Math302....
Week_7_Test_Math302.docx.docx
Course
Course
30
Chapter 1 Assigment ...
Chapter_1_Assigment_Questions.docx.docx
Course
Course
5
Week 4 tests.docx.do...
Week_4_tests.docx.docx
Course
Course
23
Week 6 tests.docx.do...
Week_6_tests.docx.docx
Course
Course
106