Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Digital Design - Computer

Architecture
디지털 설계 - 컴퓨터구조
Information Representations
Lecture 0

Brian J. d’Auriol
2023

Lecture Notes developed by Brian J. d’Auriol, permission to use material granted for non-profit, academic use, provided credit is explicitly given; all other use must request prior permission from the author.
Use Permissions
• Lecture Notes developed by Brian J. d’Auriol, permission to use
material granted for non-profit, academic use, provided credit is
explicitly given; all other use must request prior permission from the
author.

• Presentation may contain additional copyrighted images used herein


for purposes of academic teaching; all such copyrighted material
retains the original copyright terms.

Slide 2
Computer Information Representations
For computer-based information representation purposes:
Existence is binary: something exists, or it does not.

Computing Technologies

Mechanical Electrical Optical Quantum Biological

A spatial-
A circuit has qubit based
temporal location
voltage or it on spin,
has a photon or
does not photons, etc.
it does not

bit: something exists or it does not

mathematical abstractions:
value: 0 or 1
system: Boolean Algebra

Slide 3
Computer Information Representations

computing Technologies

Mechanical Electrical Optical Quantum Biological


Antikythera
mechanism, A spatial-
A circuit has qubit based
analogue temporal location
voltage or it on spin,
computer, Greek, has a photon or
does not photons, etc.
205 – 60 BCE, it does not
hand-powered
orrery (a model of
the solar system) bit: something exists or it does not

Image courtesy of Giovanni Dall'Orto.


Slide 4
Computer Information Representations

computing Technologies

Mechanical Electrical Optical Quantum Biological

Zuse Z3 (replica) Electromechanical A spatial-


qubit based
computer, original: 1941, by Konrad temporal location
on spin,
Zuse (Germany) has a photon or
photons, etc.
it does not

Slide 5
Computer Information Representations

Mechanical Electrical Optical Quantum

A spatial-
A circuit has qubit based
temporal location
voltage or it on spin,
has a photon or
does not photons, etc.
it does not

DARPA Quantum Network (2002–


2007), a quantum key distribution
network implementing a secure
communication method based on
quantum technology

Slide 6
Information Representations
Human use
sexagesimal
Human culture
decimal
binary
Computer
hexadecimal
design
octal

Slide 7
Information Representations
characters Numbers Instructions EC2204
Each number representation requires distinct
numerical operations: add, subtract, multiply, etc.

integers real (fractions) Support very large numbers


many formats Support very small numbers
Support precision, rounding
IEEE 754

binary coded 2’s complement


ASCII EBCDIC Unicode zoned decimal (BCD) sign-magnitude 1’s complement
conversion
Display only Primarily display Computations only
simple
requires font Supports computations
To display, must convert to character encoding

Conversion more complex (which almost always means to zoned format)


many formats
Packed, Positive
0 0000 5 0101
1 0001 6 0110
8421 excess 3
2 0010 7 0111 Packed: each bit stored in nibbles
3 0011 8 1000 Unpacked: each bit stored in bytes
4 0100 9 1001 Positive or negative (different rules are used)

Slide 8
Zoned Decimal Formats
Purpose: often as an intermediate format between
characters Numbers character and BCD or binary representations.
Examples:
1234 (unsigned zoned EBCDIC): F1F2F3F4
integers 1234(signed zoned EBCDIC): F1F2F3C4
-1234(signed zoned EBCDIC): F1F2F3D4
1234.56 (signed zoned EBCDIC, fixed-point, 2 decimal
places): F1F2F3F4F5C6
ASCII EBCDIC Unicode zoned 1234 (signed zoned ASCII): 31323334
-1234 (signed zoned ASCII): 31323374

3 F COBOL code example


unsigned DATA DIVISION.
WORKING-STORAGE SECTION.
other 01 WS-VAR1 PIC S9999 VALUE -1234
values
byte low order byte 01 WS-VAR2 PIC 9999 VALUE 1234
possible
zone number zone number see https://www.bmc.com/blogs/cobol-trends/ for
comments about COBOL in today’s environment.
7 4 3 0 7 4 3 0
PL/1 language also supports fixed-point
(variations of this signed: negative: EBCDIC zone is Dh , ASCII is 3 zoned decimal format specification.
rule may exist) positive: EBCDIC zone is Ch , ASCII is 7 Slide 9
Review: Numeric Representations
Binary (Base 2) to Decimal (Base 10) Binary (Base 2) to hexadecimal (Base 16)

10101001 10101001 = A 9
27 26 25 24 23 22 21 20

1 ⅹ 20 = 1 1010 910

1 ⅹ 23 = 8
Decimal (Base 10) to Hexaecimal to
1 ⅹ 25 = 32 Hexdecimal (Base 16) Decimal
10 16 10 16
1ⅹ 27 = 128 0 0 8 8 A 9
1 1 9 9 161 160
128 + 32 + 8 + 1 = 169 2 2 10 A
3 3 11 B = 160 + 9
2’complement: 1’s complement +1
-17 => 0001 0001 4 4 12 C = 169
1’s complement: => 1110 1110 5 5 13 D
2’s complement +1 => + 1 6 6 14 E
=> 1110 1111 Slide 10
7 7 15 F Slide 10

You might also like