Arsitektur Komputer
Pertemuan ke-3
- Aritmatika Komputer (2)
>>> Sistem bilangan & Format Data
D
ATAF
ORMATS
Computers
Process and store all forms of data in binary format
Human communication
Includes language, images and sounds
Data formats:
Specifications for converting data into computer-usable form
Define the different ways human data may be represented, stored and processed by a
S
OURCES OFD
ATA Binary input
Begins as discrete input
Example: keyboard input such as A 1+2=3 math
Keyboard generates a binary number code for each key
Analog
Continuous data such as sound or images
Requires hardware to convert data into binary numbers
Chapter 3 Data Formats 3-3
Computer
1101000101010101…
Input device
A 1+2=3 math
Figure 3.1 with this color scheme
C
OMMON
D
ATA
R
EPRESENTATIONS
Type of Data Standard(s)
Alphanumeric Unicode, ASCII, EDCDIC
Image (bitmapped) GIF (graphical image format)
TIF (tagged image file format)
PNG (portable network graphics)
Image (object) PostScript, JPEG, SWF (Macromedia
Flash), SVG
Outline graphics and fonts PostScript, TrueType
Sound WAV, AVI, MP3, MIDI, WMA
Page description PDF (Adobe Portable Document
Format), HTML, XML
I
NTERNALD
ATAR
EPRESENTATION Reflects the
Complexity of input source
Type of processing required
Trade-offs
Accuracy and resolution
Simple photo vs. painting in an art book
Compactness (storage and transmission)
More data required for improved accuracy and resolution Compression represents data in a more compact form
Metadata: data that describes or interprets the meaning of data
Ease of manipulation:
Processing simple audio vs. high-fidelity sound
Standardization
Proprietary formats for storing and processing data (WordPerfect vs. Word) De facto standards: proprietary standards based on general user
acceptance (PostScript) 3-5 Cha p te r 3 Da ta F o rm a ts
D
ATAT
YPES: A
LPHANUMERIC
Alphanumeric:
Characters: b T
Number digits: 7 9
Punctuation marks: ! ;
Special-purpose characters: $ &
Numeric characters vs. numbers
Both entered as ordinary characters
Computer converts into numbers for calculation
Examples: Variables declared as numbers by the
programmer (Salary$ in BASIC)
Treated as characters if processed as text
Examples: Phone numbers, ZIP codes
Cha p te r 3 Da ta F o rm a ts
R
EPRESENTINGC
HARACTERS ASCII - most widely used coding scheme EBCDIC: IBM mainframe (legacy)
Unicode: developed for worldwide use
3-7 Cha p te r 3 Da ta F o rm a ts
ASCII
Developed by ANSI (American National Standards
Institute)
Represents
Latin alphabet, Arabic numerals, standard punctuation characters
Plus small set of accents and other European special characters
ASCII
7-bit code: 128 characters
Cha p te r 3 Da ta F o rm a ts
ASCII R
EFERENCET
ABLE MSD LSD 0 1 2 3 4 5 6 7 0 NUL DLE SP 0 @ P p 1 SOH DC1 ! 1 A Q a W 2 STX DC2 “ 2 B R b r 3 ETX DC3 # 3 C S c s 4 EOT DC4 $ 4 D T d t 5 ENQ NAK % 5 E U e u6 ACJ SYN & 6 F V f v
7 BEL ETB ‘ 7 G W g w 8 BS CAN ( 8 H X h x 9 HT EM ) 9 I Y i y A LF SUB * : J Z j z B VT ESC + ; K [ k { C FF FS , < L \ l | D CR GS - = M ] m } E SO RS . > N ^ n ~ F SI US / ? O _ o DEL
Chapter 3 Data Formats 3-9
7416 111 0100
EBCDIC
Extended Binary Coded Decimal Interchange
Code developed by IBM
Restricted mainly to IBM or IBM compatible mainframes
Conversion software to/from ASCII available
Common in archival data
Character codes differ from ASCII
ASCII EBCDIC
Space 2016 4016
A 4116 C116
U
NICODE
Most common 16-bit form represents
65,536 characters
ASCII Latin-I subset of Unicode
Values 0 to 255 in Unicode table
Multilingual: defines codes for
Nearly every character-based alphabet
Large set of ideographs for Chinese, Japanese and Korean
Composite characters for vowels and syllabic clusters required by some languages
Allows software modifications for
local-languages
3-11 Cha p te r 3 Da ta F o rm a tsC
OLLATINGS
EQUENCE
Alphabetic sorting if software handles mixed
upper- and lowercase codes
In ASCII, numbers collate first; in EBCDIC, last
ASCII collating sequence for string of
characters
Letters Numeric Characters
Adam A d a m 1 011 0001
Adamian A d a m i a n 12 011 0001 011 0010
2 C
LASSES OFC
ODES
Printing
characters
Produced on the screen or printer
Control
characters
Control position of output on screen or printer
Cause action to occur
Communicate status between computer and I/O device
VT: vertical tab LF: Line feed
ESC: provides extensions by changing the meaning of a specified number of contiguous following characters
Chapter 3 Data Formats 3-13
K
EYBOARDI
NPUT
Scan code
Two different scan codes on keyboard
One generated when key is struck and another when
key is released
Converted to Unicode, ASCII or EBCDIC by software in terminal or PC
Advantage
Easily adapted to different languages or keyboard layout
Separate scan codes for key press/release for multiple key combinations
Examples: shift and control keys
Cha p te r 3 Da ta F o rm a ts
O
THERA
LPHANUMERICI
NPUT OCR (optical character reader)
Scans text and inputs it as character data
Used to read specially encoded characters
Example: magnetically printed check numbers
General use limited by high error rate
Bar Code Readers
Used in applications that require fast, accurate and repetitive input with minimal employee training
Examples: supermarket checkout counters and inventory control
Alphanumeric data in bar code read optically using wand
Magnetic stripe reader: alphanumeric data from credit cards Voice
Digitized audio recording common but conversion to alphanumeric data difficult
Requires knowledge of sound patterns in a language (phonemes) plus
rules for pronunciation, grammar, and syntax
3-15 Cha p te r 3 Da ta F o rm a ts
I
MAGED
ATA Photographs, figures, icons, drawings, charts and
graphs
Two approaches:
Bitmap or raster images of photos and paintings with continuous variation
Object or vector images composed of graphical objects like lines and curves defined geometrically
Differences include:
Quality of the image
Storage space required Time to transmit
Ease of modification
Specifications for graphics file formats
The Graphics File Format Page
Cha p te r 3 Da ta F o rm a ts
O
BJECTI
MAGES
Created by
drawing
packages or output from
spreadsheet data graphs
Composed of lines and shapes in various
colors
Computer translates geometric formulas to
create the graphic
Storage space depends on image complexity
number of instructions to create lines, shapes, fill patterns
Movies Shrek and Toy Story use object
images
3-17 Cha p te r 3 Da ta F o rm a tsD
ATAC
OMPRESSION Compression: recoding data so that it requires
fewer bytes of storage space.
Compression ratio: the amount file is shrunk
Lossless: inverse algorithm restores data to exact
original form
Examples: GIF, PCX, TIFF
Lossy: trades off data degradation for file size and
download speed
Much higher compression ratios, often 10 to 1 Example: JPEG
Common in multimedia
MPEG-2: uses both forms for ratios of 100:1
Cha p te r 3 Da ta F o rm a ts
I
NTERNAL
C
OMPUTER
D
ATA
F
ORMAT
All data stored as binary numbers Interpreted based on
Operations computer can perform
Data types supported by programming language used to create application 3-19 Cha p te r 3 Da ta F o rm a ts
5 S
IMPLED
ATAT
YPES Boolean: 2-valued variables or constants with values of
true or false
Char: Variable or constant that holds alphanumeric
character
Enumerated
User-defined data types with possible values listed in definition
Type DayOfWeek = Mon, Tues, Wed, Thurs, Fri, Sat, Sun Integer: positive or negative whole numbers
Real
Numbers with a decimal point
Numbers whose magnitude, large or small, exceeds computer’s capability to store as an integer
Cha p te r 3 Da ta F o rm a ts
KUIS
KE
-2
Ubah 6 angka desimal pada
NIM anda menjadi bilangan
biner, oktal, dan heksa
Untuk masing-masingnya,
tunjukkan mana nilai MSB dan
mana nilai LSB
PERKEMBANGAN
PERANGKAT KERAS
KOMPUTER
Materi :
Minggu III 23
ENIAC
E
lectronic
N
umerical
I
ntegrator
A
nd
C
omputer
Eckert and Mauchly
University of Pennsylvania
Tabel lintasan peluru
Mulai dibuat tahun 1943
Selesai tahun 1946
Terlambat digunakan dalam perang dunia
Dipakai sampai 1955
Detail dari ENIAC
Menggunakan sistem Decimal (bukan
binary)
Memiliki 20 accumulators untuk 10 digits
Diprogram secara manual melalui saklar (
switches )
Berisi 18,000 tabung vakum
Berat 30 tons
Volume 15,000 kaki persegi
Daya listrik 140 kW
Minggu III 25
von Neumann/Turing
Konsep : program tersimpan (Stored Program) Memori Utama, untuk menyimpan data maupun
instruksi
Arithmetic Logic Unit (ALU), untuk mengolah
data binner
Control Unit, untuk melakukan interpretasi
instruksi - instruksi di dalam memori sehingga adanya eksekusi instruksi tersebut
I/0, untuk berinteraksi dengan lingkungan luar Computer of Institute for Advanced Studies
(IAS)
Struktur Mesin Von Nuemann
Main Memory
Arithmetic and Logic Unit
Program Control Unit Input
Output Equipment
Minggu III 27
Detail - IAS
Kapasitas memori : 1000 x 40 bit words
Menggunakan sistem bilangan Binary
Panjang instruksi 2 x 20 bit instruksi 20 bit
Register-register dalam CPU :
Memory Buffer Register = MBR
Memory Address Register = MAR
Instruction Register = IR
Instruction Buffer Register = IBR
Program Counter = PC
Accumulator = AC
Structure of IAS - detail
Main Memory Arithmetic and Logic Unit
Program Control Unit Input Output Equipment MBR
Arithmetic & Logic Circuits MQ Accumulator MAR Control Circuits IBR IR PC Address Instructions & Data
Minggu III 29
Memory Buffer Register (MBR), berisi sebuah word yang
akan disimpan di dalam memori atau digunakanuntuk menerima word dari memori.
Memory Address Register (MAR), untuk menentukan
alamat word di memori untuk dituliskan dari MBR atau dibaca oleh MBR.
Instruction Register (IR), berisi instruksi 8 bit kode
operasi yang akan dieksekusi.
Instruction Buffer Register (IBR), digunakan untuk
penyimpanan sementara instruksi sebelah kanan word di dalam memori.
Program Counter (PC), berisi alamat pasangan instruksi
berikutnya yang akan diambil dari memori.
Accumulator (AC) dan Multiplier Quotient (MQ),
digunakan untuk penyimpanan sementara operand dan hasil ALU. Misalnya, hasil perkalian 2 buah bilangan 40 bit adalah sebuah bilangan 80 bit; 40 bit yang paling berarti MSB disimpan dalam AC dan 40 bit lainnya LSB disimpan dalam MQ.
Keterangan Gambar ……Lanjutan
IAS beroperasi secara berulang membentuk siklus
instruksi. Komputer IAS memiliki 21 instruksi, yang
dapat dikelompokkan seperti berikut ini :
◦ Data tranfer, memindahkan data di antara memori
dengan register – register ALU atau antara dua register ALU sendiri.
◦ Unconditional branch, perintah – perintah
eksekusi percabangan tanpa syarat tertentu.
◦ Conditional branch, perintah – perintah eksekusi
percabangan yang memerlukan syarat tertentu agar dihasilkan suatu nilai dari percabangan tersebut.
◦ Arithmetic, kumpulan operasi – operasi yang
dibentuk oleh ALU.
◦ Address Modify, instruksi – instruksi yang
memungkinkan pengubahan alamat saat di
komputasi sehingga memungkinkan fleksibilitas alamat yang tinggi pada program.
Minggu III 31
Komputer Komersial
1947 - Eckert-Mauchly Computer Corporation
UNIVAC I (Universal Automatic Computer) Untuk kalkulasi sensus 1950 oleh US Bureau
Menjadi divisi dari Sperry-Rand Corporation
Dipasarkan akhir tahun 1950 - UNIVAC II
Lebih cepat
IBM
Pabrik peralatan Punched-card
1953 - IBM 701
Komputer pertama IBM ( stored program
computer )
Untuk keperluan aplikasi Scientific
1955 - IBM 702
Untuk aplikasi Business
Merupakan awal dari seri 700/7000 yang
membuat IBM menjadi pabrik komputer yang
dominan
Minggu III 33
Transistor
Menggantikan vacuum tubes
Lebih kecil
Lebih murah
Disipasi panas sedikit
Merupakan komponen Solid State
Dibuat dari Silicon (Sand)
Ditemukan pada tahun 1947 di laboratorium
Bell
Komputer Berbasis Transistor
Mesin generasi II
NCR & RCA menghasilkan small transistor machines
IBM 7000
DEC - 1957
Minggu III 35
Microelectronics
Secara harafiah berarti “ elektronika kecil”
Sebuah komputer dibuat dari gerbang logika
(gate), memory cells and interconnections
Sejunlah gate dikemas dalam satu keping semi
konduktor
Beberapa Generasi Komputer
Vacuum tube - 1946-1957
Transistor - 1958-1964
Small scale integration - 1965 on
◦ Up to 100 devices on a chip
Medium scale integration - to 1971
◦ 100-3,000 devices on a chip
Large scale integration - 1971-1977
◦ 3,000 - 100,000 devices on a chip
Very large scale integration - 1978 to date
◦ 100,000 - 100,000,000 devices on a chip Ultra large scale integration
Minggu III 37
Hukum Moore
Meningkatkan kerapatan komponen dalam chip Gordon Moore - cofounder of Intel
Jumlah transistor/ chip meningkat 2x lipet per tahun Sejak tahun 1970 pengembangan sedikit agak
lambat
Jumlah transistor 2x lipat setiap 18 bulan Harga suatu chip tetap/ hampir tidak berubah
Kerapatan tinggi berarti jalur pendek, menghasilkan kinerja yang meningkat
Ukuran semakin kecil, fleksibilitas meningkat Daya listrik lebih hemat, panas menurun
Perkembangan Jumlah Transistor
dalam CPU
Minggu III 39
IBM Seri 360
1964
Pengganti (& not compatible with) seri 7000 Rancangan awal suatu “family” computer
Memiliki set instruksi yang sama atau identik Menggunakan O/S yang sama atau identik Kecepatan meningkat
Jumlah port I/O meningkat (i.e. Terminal banyak) Kapasitas memory bertambah besar
Harga meningkat
DEC PDP-8
1964
Minicomputer pertama (after miniskirt!)
Tidak mengharuskan ruangan ber-AC
Ukurannya kecil
Harga $16,000
$100k+ untuk IBM 360
Embedded applications & OEM
Menggunakan struktur BUS
Minggu III 41
Struktur BUS DEC - PDP-8
OMNIBUS Console
Controller
CPU Main Memory I/OModule I/O Module
Memori Semiconductor
1970
Fairchild
Ukuran kecil sebesar 1 sel core memory
Dapat menyimpan 256 bits
Non-destructive read
Lebih cepat dari core memory
Minggu III 43
Intel
1971 - 4004
First microprocessor
All CPU components on a single chip 4 bit
Followed in 1972 by 8008 8 bit
Digunakan untuk aplikasi khusus
1974 – 8080 , Mikroprosesor pertama Inte 1978 – 8086, 80286
1985- 80386 1989 - 80486
8080, keluar tahun 1972 merupakan mikroprosesor
pertama keluaran Intel dengan mesin 8 bit dan bus data ke memori juga 8 bit. Jumlah instruksinya 66 instruksi dengan kemampuan pengalamatan 16KB.
8086, dikenalkan tahun 1974 adalah mikroprosesor
16 bit dengan teknologi cache instruksi. Jumlah
instruksi mencapai 111 dan kemampuan pengalamatan ke memori 64KB.
80286, keluar tahun 1982 merupakan
pengembangan dari 8086, kemampuan
pengalamatan mencapai 1MB dengan 133 instruksi.
80386, keluar tahun 1985 dengan mesin 32 bit.
Sudah mendukung sistem multitasking. Dengan mesin 32 bitnya, produk ini mampu menjadi
terunggul pada masa itu.
80486, dikenalkan tahun 1989. Kemajuannya pada
teknologi cache memori dan pipelining instruksi. Sudah dilengkapi dengan math co-processor.
Minggu III 45
Pentium, dikeluarkan tahun 1993, menggunakan
teknologi superscalar sehingga memungkinkan eksekusi instruksi secara paralel.
Pentium Pro, keluar tahun 1995. Kemajuannya pada
peningkatan organisasi superscalar untuk proses
paralel, ditemukan sistem prediksi cabang, analisa
aliran data dan sistem cache memori yang makin canggih.
Pentium II, keluar sekitar tahun 1997 dengan
teknologi MMX sehingga mampu menangani kebutuhan multimedia. Mulai Pentium II telah menggunakan teknologi RISC.
Pentium III, terdapat kemampuan instruksi floating
point untuk menangani grafis 3D SSE
Pentium IV, kemampuan floating point dan
multimedia semakin canggih
Itanium, memiliki kemampuan 2 unit floating point, 4
unit integer, 3 unit pencabangan, internet streaming, 128 interger register.
Meningkatkan Kecepatan
Pipelining
On board cache
On board L1 & L2 cache
Branch prediction
Data flow analysis
Minggu III 47
Peningkatan Kinerja
Kecepatan Processor meningkat
Kapasitas Memory meningkat
Kecepatan Memory tertinggal dari kecepatan
processor
DRAM and Processor
Characteristics
Minggu III 49
Solusi
Meningkatkan jumlah bit per akses
Make DRAM “wider” rather than “deeper” Mengubah interface DRAM
Cache
Mengurangi frequency akses memory
cache yang lebih komplek dan cache on chip Meningkatkan interkoneksi bandwidth
Bus kecepatan tinggi - High speed buses Hierarchy of buses