SlideShare uma empresa Scribd logo
1 de 38
Sistem Bilangan
Oleh :
Ahmad Haidaroh
Analogue vs Digital
Analogue
* Continuous range of value
* Precision limited by Noise
Digital
* Discrete range of values
* Precision limited by number of “Bit”
Analogue vs Digital
Analogue Digital
Analogue vs Digital
The real world is analogue ( by because
all signal in world be shape analogue)
But in controlling, Digital one had using
for process.
Both of signal had been converter each
other
Analoge vs Digital
Analogue A to D
Digital
Processing
D to A Analogue
Why Digital Only by using in Processing?
^ Adventure in integrated Circuit has made the complex processing of
digital data.
^ Digital Control processing has made easier than analogue
^ Digital circuits are inherently more noise resistant
Digital and Boolean
Digital represented by boolean logic
Boolean is the name of mathematician’s
expert
Now boolean is called by conventional
logic because there is new logic that
called by fuzzy logic
But all electronic still using boolean logic
to processing the controlling system
Why Boolean
 It is convenient in electrical system to use a two-value
system to represent value true/false, on/off, yes/no
and 1/0
* Two voltage or current levels can be used
* Easier to process and distribute reliably (diandalkan)
* Don’t think of them as numbers (even though we often
represent them as 0/1 for brevity(ketangkasan))
 The need for binary numbers
* Multi-value quantities need to be represented in the
digital system. Therefore need numbers made up from
the simple two value system
Number System
 Decimal base 10  0 1 2 3 4 5 6 7 8 9
 Biner base 2  0 1
 Octal base 8  0 1 2 3 4 5 6 7
 Hexadecimal base 16  0 1 2 3 4 5 6 7 8 9
A B C D E F
Positional Number System
3578.778
8x10-3
8 x 100
7 x 101
5 x 102
3 x 103
7x10-2
7x10-1
Decimal point
Base 10, weigthing are powers of 10
Unsigned binary numbers
1100.101
1 x 2-3
= 0.125
0 x 20
= 0.000
0 x 21
= 0.000
1 x 22
= 4.000
1 x 23
= 8.000
0 x 2-2
= 0.000
1 x 2-1
= 0.500
Binary point
Each bit of the
Number may be
Representaed by
A Boolean value
Binary, weightings are powers of 2
Binary System
Misal : 1001
1 x 2 3
+ 0 x 2 2
+ 0 x 2 1
+ 1 x 2 0
A1 B1
A2 B2
+
B3
Carry
Flag
Carry
Flag
A2
Carry
Out
Carry
In
Carry
Out
Multi-precision Arithmatic
Additional of A and B
Multi-precision Arithmatic
A1 B1
A2 B2
-
B3
Carry
Flag
A2
Carry
Out
Carry
In
Hexadecimal Numbers
660
: 164
41
: 169
2
Hexadecimal : 294 Hex
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
215
: 1613
7
Hexadecimal : 7D Hex
Hexadecimal Numbers
660 0010 1001 0100
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
2 9 4
215 0000 1101 0111
0 D 7
Decimal to Binary
Number = 36.37
5
Base = 2
Decimal
Number
Binary
Digits
Converter Number
0 0 0100100.0110
0.5 1 0100100.011
0.75 1 0100100.01
0.375 0 0100100.0
36 0 0100100
18 0 010010
9 1 01001
4 0 0100
2 0 010
1 1 01
0 0 0
Generete each digit by successive division
Or multiplication.
There is no guarantee the fraction will be
finite
Fractional part – Multiplication by base
Whole part – divition by base
Binary Additional
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 0 carry 1
Easy Layaou ?
Binary Addition
190 + 141 =331
1 0 1 1 1 1 1 0
1 0 0 0 1 1 0 1
110
1
1
1
0
1
0
1
101
Carry out of
8-bit number
1
Carry out of
Each column
Binary Subtraction
229 – 46 = 183
1 1 1 0 0 1 0 1
0 0 1 0 1 1 1 0
1
1
2
1
1
2
10
1
2
1
2
1
1
2
101
Borrow out
Borrow in from
Left column
A borrow-out of 1 from
This column becomes a borrow in
of 2 in this column
Both rows subtracted
Exercise
Convert to 8-bit binary and do the
arithmetic operation
* 120 + 54 * 110 + 100
* 224 – 134 * 200 + 20
* 112 – 89 * 111 – 25
Convert back to decimal and check the
result
Binary Number Circle
4 – bit
Binary
Number Circle
In real hardware there is a fixed number
Of bits available. We often ignore leading zeros
But they are still there!
Examlpe :
If we only use 4 bits then the binary
Counting sequence “wraps around”
At 15 ↔ 0
11 - 1 = 10
11 1011
- 1 1
10 1010
Binary Number Circle
4 – bit
Binary
Number Circle
Subtracting across the boundary
Still “works” if you think of result
As the distance on the number
Circle.
(Module arithmetic – ignore
The borrow /carry)
8 1000
- 14 - 1110
10 (-1)1010
Representing –ve Number
Several choices for notation
* sign + magnitude notation
* 1’s complement
* 2’s complement notation
* various ‘excess codes ‘
Sign Number – sign + magnitude
Notation
Sign Bit Magnitude
0  +ve Simple binary number
1  - ve
Problem ?
How about Null or Zero
+ 0  0000
- 0  1000
Signed Numbers – Sign +
magnitude Notation
Arithmetic
 Difficult to do – have to work out that operation to
perform
 5 + -6 actually calculate –(6-5) i.e. exchange the
operands and do subtraction!
 -5+ -6 actually calculate –(5+6) i.e. negate the addition
of the negated numbers !
 Required action depends the signs of the numbers
and on which has the large magnitude. Natural for us
–a bit hard for the computer since the only way it can
work out the bigger number is to do a subtraction!
Sign + Magnitude Examples
Value
4-bit sign +
magnitude
8-bit sign + magnitude
+7 0111 00000111
+6 0110 00000110
…… …… ……
+1 0001 00000001
+0 0000 00000000
-0 1000 10000000
-1 1001 10000001
-2 1010 10000010
…… …… ……
-7 1111 10000111
Sign Numbers – 2’s
Complement
 As for straight binary numbers but with the
weighting of the most significant bit being
negative
 Example
* 4 bit – weights are -8, 4,2,1
* 8 bit – weights are -128, 64,32,16,8,4,2,1
 Need to know how many bits are being used
to work out the value of the number – don’t
omit leading zeroes
Sign Numbers – 2’s
Complement
1100.101
1 x 2-3
= 0.125
0 x 20
= 0.000
0 x 21
= 0.000
1 x 22
= 4.000
1 x 23
= -8.000
0 x 2-2
= 0.000
1 x 2-1
= 0.500
Binary point
Sign Bit
Binary, weightings are powers of 2
-4.375
2’s Complement Examples
Value
4-bit sign 2’s
complement
8-bit sign complement
+7 0111 00000111
+6 0110 00000110
…… …… ……
+1 0001 00000001
+0 0000 00000000
-1 1111 11111111
-2 1110 11111110
…… -8+berapa = bil -128+berapa = bil
-7 1001 11111001
-8 1000 11111000
2’s Complement Examples (4 bit)
Example : -4 (decimal)
Become 4 = 0100 ( binary)
= 1x22
= 4
2’s Complement
-4= 1100 (binary)
= -(23
) + 22
= -8 + 4
= -4
Exercise
Converse decimal number above into
negative (2’s complement) :
1. -7 ( 4 digit ) 6. 6 (4 digit)
2. -7 (8 digit) 7. 10 (8 digit)
3. -12 (8 digit) 8. 30 (8 digit)
4. -20 (8 digit) 9. 98 (digit)
5. -100 (8 digit) 10. 126 (digit)
Addition 2’s Complement
For 4 digit :
4 0100
3 + 0011 +
7 0111
22
+21
+20
= 4+2+1 =7
Addition 2’s Complement
For 4 digit
-1 1111
-2 + 1110 +
-3 11101
-(8)+4 +0 + 1 = -3
Carry out
Exercise
For 4 Digit :
1. 7 + (-5)
2. -6 + -1
3. 3 + 4
4. 2 + 3
5. -4 + 7
Converse all item to digital and addition.
And then Converse to decimal again
Subtraction 2’s Complement
+ 7 0111
+ 3 (0011)- 1101 +
+4 10100
Discard
Subtraction 2’s Complement
(-8) 1000
(-3) = 1101 - 0011 +
-5 1011
Exercise
for 4 digit . Converse decimal above to
digit and subtraction. After that
converse to decimal again :
1. (+3) – (-3)
2. (-4) – (+2)
3. (-8)- (+4)
4. (-3) – (-4)
5. (7) – (5)
2’s Complement ALU
 Addition and subtraction use the same rules as
unsigned binary.
 Same hardware may be used for both
 Carry (C) is used for unsigned, overflow (v) for signed
C=Carry
V=overflow
OP
Signed Numbers
Signed Numbers
C=Carry
V=overflow
OP
Signed Numbers
Signed Numbers
The same
hardware
Arithmetic Flags in
Condition code register (CCR)

Mais conteúdo relacionado

Mais procurados

Number system
Number systemNumber system
Number system
kashee99
 

Mais procurados (20)

Number system utm notes
Number system utm notesNumber system utm notes
Number system utm notes
 
Number system
Number systemNumber system
Number system
 
Chapter 1: Binary System
 Chapter 1: Binary System Chapter 1: Binary System
Chapter 1: Binary System
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital Electronics
 
Binary number ppt
Binary number pptBinary number ppt
Binary number ppt
 
binary number system
 binary number system binary number system
binary number system
 
Binary number systems
Binary number systemsBinary number systems
Binary number systems
 
1
11
1
 
Number System Conversion
Number System ConversionNumber System Conversion
Number System Conversion
 
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
FYBSC IT Digital Electronics Unit I Chapter II Number System and Binary Arith...
 
Representation of Signed Numbers - R.D.Sivakumar
Representation of Signed Numbers - R.D.SivakumarRepresentation of Signed Numbers - R.D.Sivakumar
Representation of Signed Numbers - R.D.Sivakumar
 
09 binary number systems
09   binary number systems09   binary number systems
09 binary number systems
 
Number systems ppt
Number systems pptNumber systems ppt
Number systems ppt
 
Number System
Number SystemNumber System
Number System
 
Number system
Number systemNumber system
Number system
 
Basics of digital electronics
Basics of digital electronicsBasics of digital electronics
Basics of digital electronics
 
Number system
Number system  Number system
Number system
 
Binary Codes and Number System
Binary Codes and Number SystemBinary Codes and Number System
Binary Codes and Number System
 
Floating point presentation
Floating point presentationFloating point presentation
Floating point presentation
 
Number system
Number systemNumber system
Number system
 

Destaque

Destaque (20)

Teknik Optimasi - P8
Teknik Optimasi - P8Teknik Optimasi - P8
Teknik Optimasi - P8
 
Presentasi Ordik 2016
Presentasi  Ordik   2016Presentasi  Ordik   2016
Presentasi Ordik 2016
 
Pertemuan 1 - Pendahuluan
Pertemuan 1 -  PendahuluanPertemuan 1 -  Pendahuluan
Pertemuan 1 - Pendahuluan
 
CFG dan PARSING - P 5 - Teknik Kompilasi
CFG dan PARSING - P 5 - Teknik KompilasiCFG dan PARSING - P 5 - Teknik Kompilasi
CFG dan PARSING - P 5 - Teknik Kompilasi
 
Image Compression - Citra Digital
Image Compression - Citra DigitalImage Compression - Citra Digital
Image Compression - Citra Digital
 
Pertemuan 0 - Sejarah Elektronika
Pertemuan 0 - Sejarah ElektronikaPertemuan 0 - Sejarah Elektronika
Pertemuan 0 - Sejarah Elektronika
 
Sistem Homogen dan Invers-Matrik - Pertemuan 5.
Sistem Homogen dan Invers-Matrik - Pertemuan 5. Sistem Homogen dan Invers-Matrik - Pertemuan 5.
Sistem Homogen dan Invers-Matrik - Pertemuan 5.
 
Analisis leksikal tugas
Analisis leksikal tugasAnalisis leksikal tugas
Analisis leksikal tugas
 
Analisis Leksikal - P4
Analisis Leksikal - P4Analisis Leksikal - P4
Analisis Leksikal - P4
 
Modul 1 pengenalan kecerdasan buatan
Modul 1   pengenalan kecerdasan buatanModul 1   pengenalan kecerdasan buatan
Modul 1 pengenalan kecerdasan buatan
 
P 1 Pendahuluan - Teknik Kompilasi
P 1 Pendahuluan - Teknik KompilasiP 1 Pendahuluan - Teknik Kompilasi
P 1 Pendahuluan - Teknik Kompilasi
 
Presentasi internet
Presentasi internetPresentasi internet
Presentasi internet
 
Bahasa Regular - P3
Bahasa Regular - P3Bahasa Regular - P3
Bahasa Regular - P3
 
P 2 Konsep & Notasi Bahasa - Teknik Kompilasi
P 2 Konsep & Notasi Bahasa - Teknik KompilasiP 2 Konsep & Notasi Bahasa - Teknik Kompilasi
P 2 Konsep & Notasi Bahasa - Teknik Kompilasi
 
Pertemuan 5a gerbang kombinasi-maxtem-minterm
Pertemuan 5a   gerbang kombinasi-maxtem-mintermPertemuan 5a   gerbang kombinasi-maxtem-minterm
Pertemuan 5a gerbang kombinasi-maxtem-minterm
 
Notasi Bahasa - P 5,6,7
Notasi Bahasa - P 5,6,7 Notasi Bahasa - P 5,6,7
Notasi Bahasa - P 5,6,7
 
Error Handling - P 7 Teknik Kompilasi
Error Handling - P 7 Teknik Kompilasi Error Handling - P 7 Teknik Kompilasi
Error Handling - P 7 Teknik Kompilasi
 
Pertemuan 1 - Introduction - Citra Digital
Pertemuan 1 - Introduction - Citra DigitalPertemuan 1 - Introduction - Citra Digital
Pertemuan 1 - Introduction - Citra Digital
 
Analisis Semantik - P 6 Teknik Kompilasi
Analisis Semantik - P 6 Teknik KompilasiAnalisis Semantik - P 6 Teknik Kompilasi
Analisis Semantik - P 6 Teknik Kompilasi
 
Penelitian Operasional 1 - Pendahuluan
Penelitian Operasional 1 - PendahuluanPenelitian Operasional 1 - Pendahuluan
Penelitian Operasional 1 - Pendahuluan
 

Semelhante a Pertemuan 2 - Sistem Bilangan

Alu1
Alu1Alu1

Semelhante a Pertemuan 2 - Sistem Bilangan (20)

Alu1
Alu1Alu1
Alu1
 
Video lectures
Video lecturesVideo lectures
Video lectures
 
Mba ebooks
Mba ebooksMba ebooks
Mba ebooks
 
Lesson plan on data representation
Lesson plan on data representationLesson plan on data representation
Lesson plan on data representation
 
DLD-Introduction.pptx
DLD-Introduction.pptxDLD-Introduction.pptx
DLD-Introduction.pptx
 
Number system and codes
Number system and codesNumber system and codes
Number system and codes
 
Complement
ComplementComplement
Complement
 
Digital Logic Design.pptx
Digital Logic Design.pptxDigital Logic Design.pptx
Digital Logic Design.pptx
 
2013 1
2013 1 2013 1
2013 1
 
Number system
Number systemNumber system
Number system
 
ADE UNIT-III (Digital Fundamentals).pptx
ADE UNIT-III (Digital Fundamentals).pptxADE UNIT-III (Digital Fundamentals).pptx
ADE UNIT-III (Digital Fundamentals).pptx
 
Number_Systems (2).ppt
Number_Systems (2).pptNumber_Systems (2).ppt
Number_Systems (2).ppt
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
 
21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx
 
Number system
Number systemNumber system
Number system
 
Chapter 2.1 introduction to number system
Chapter 2.1 introduction to number systemChapter 2.1 introduction to number system
Chapter 2.1 introduction to number system
 
Unit-1 Digital Design and Binary Numbers:
Unit-1 Digital Design and Binary Numbers:Unit-1 Digital Design and Binary Numbers:
Unit-1 Digital Design and Binary Numbers:
 

Mais de ahmad haidaroh

Mais de ahmad haidaroh (20)

Materi 7 Context Free Grammar
Materi 7   Context Free Grammar Materi 7   Context Free Grammar
Materi 7 Context Free Grammar
 
8 Rekursif
8 Rekursif8 Rekursif
8 Rekursif
 
6 ANTRIAN - QUEUE
6 ANTRIAN - QUEUE6 ANTRIAN - QUEUE
6 ANTRIAN - QUEUE
 
5 STACK
5 STACK5 STACK
5 STACK
 
4 Adt
4 Adt4 Adt
4 Adt
 
3 Linked List
3   Linked List3   Linked List
3 Linked List
 
2 Array
2 Array2 Array
2 Array
 
Materi 4 Regular Expression
Materi 4   Regular ExpressionMateri 4   Regular Expression
Materi 4 Regular Expression
 
Materi 3 Finite State Automata
Materi 3   Finite State AutomataMateri 3   Finite State Automata
Materi 3 Finite State Automata
 
Materi 3 Finite State Automata
Materi 3   Finite State AutomataMateri 3   Finite State Automata
Materi 3 Finite State Automata
 
Presentasi OSPEK 2018
Presentasi OSPEK 2018Presentasi OSPEK 2018
Presentasi OSPEK 2018
 
Pertemuan 4 Dioda1
Pertemuan 4   Dioda1Pertemuan 4   Dioda1
Pertemuan 4 Dioda1
 
Pertemuan 4 Aljabar Boole
Pertemuan 4   Aljabar Boole Pertemuan 4   Aljabar Boole
Pertemuan 4 Aljabar Boole
 
Pertemuan 2&3 - Dasar2 Keamanan Encyption
Pertemuan 2&3 - Dasar2 Keamanan EncyptionPertemuan 2&3 - Dasar2 Keamanan Encyption
Pertemuan 2&3 - Dasar2 Keamanan Encyption
 
Multiplekser - Demultiplekser - Pertemuan 7
Multiplekser - Demultiplekser - Pertemuan 7Multiplekser - Demultiplekser - Pertemuan 7
Multiplekser - Demultiplekser - Pertemuan 7
 
Pertemuan 3a Rangkaian Aritmatik-Half n Full Adder
Pertemuan 3a   Rangkaian Aritmatik-Half n Full AdderPertemuan 3a   Rangkaian Aritmatik-Half n Full Adder
Pertemuan 3a Rangkaian Aritmatik-Half n Full Adder
 
Pertemuan 6 Penyederhanaan RL-Karnaugh Map
Pertemuan 6   Penyederhanaan RL-Karnaugh MapPertemuan 6   Penyederhanaan RL-Karnaugh Map
Pertemuan 6 Penyederhanaan RL-Karnaugh Map
 
Pertemuan 5 gerbang logika dasar n bentukan
Pertemuan 5   gerbang logika dasar n bentukanPertemuan 5   gerbang logika dasar n bentukan
Pertemuan 5 gerbang logika dasar n bentukan
 
Aritmatika Biner - Pertemuan 3
Aritmatika Biner - Pertemuan 3Aritmatika Biner - Pertemuan 3
Aritmatika Biner - Pertemuan 3
 
Pertemuan 2 - Sistem Bilangan - Ahmad
Pertemuan 2 - Sistem Bilangan - AhmadPertemuan 2 - Sistem Bilangan - Ahmad
Pertemuan 2 - Sistem Bilangan - Ahmad
 

Último

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Último (20)

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 

Pertemuan 2 - Sistem Bilangan

  • 2. Analogue vs Digital Analogue * Continuous range of value * Precision limited by Noise Digital * Discrete range of values * Precision limited by number of “Bit”
  • 4. Analogue vs Digital The real world is analogue ( by because all signal in world be shape analogue) But in controlling, Digital one had using for process. Both of signal had been converter each other
  • 5. Analoge vs Digital Analogue A to D Digital Processing D to A Analogue Why Digital Only by using in Processing? ^ Adventure in integrated Circuit has made the complex processing of digital data. ^ Digital Control processing has made easier than analogue ^ Digital circuits are inherently more noise resistant
  • 6. Digital and Boolean Digital represented by boolean logic Boolean is the name of mathematician’s expert Now boolean is called by conventional logic because there is new logic that called by fuzzy logic But all electronic still using boolean logic to processing the controlling system
  • 7. Why Boolean  It is convenient in electrical system to use a two-value system to represent value true/false, on/off, yes/no and 1/0 * Two voltage or current levels can be used * Easier to process and distribute reliably (diandalkan) * Don’t think of them as numbers (even though we often represent them as 0/1 for brevity(ketangkasan))  The need for binary numbers * Multi-value quantities need to be represented in the digital system. Therefore need numbers made up from the simple two value system
  • 8. Number System  Decimal base 10  0 1 2 3 4 5 6 7 8 9  Biner base 2  0 1  Octal base 8  0 1 2 3 4 5 6 7  Hexadecimal base 16  0 1 2 3 4 5 6 7 8 9 A B C D E F
  • 9. Positional Number System 3578.778 8x10-3 8 x 100 7 x 101 5 x 102 3 x 103 7x10-2 7x10-1 Decimal point Base 10, weigthing are powers of 10
  • 10. Unsigned binary numbers 1100.101 1 x 2-3 = 0.125 0 x 20 = 0.000 0 x 21 = 0.000 1 x 22 = 4.000 1 x 23 = 8.000 0 x 2-2 = 0.000 1 x 2-1 = 0.500 Binary point Each bit of the Number may be Representaed by A Boolean value Binary, weightings are powers of 2
  • 11. Binary System Misal : 1001 1 x 2 3 + 0 x 2 2 + 0 x 2 1 + 1 x 2 0
  • 13. Multi-precision Arithmatic A1 B1 A2 B2 - B3 Carry Flag A2 Carry Out Carry In
  • 14. Hexadecimal Numbers 660 : 164 41 : 169 2 Hexadecimal : 294 Hex 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7 8 9 A B C D E F 215 : 1613 7 Hexadecimal : 7D Hex
  • 15. Hexadecimal Numbers 660 0010 1001 0100 0 1 2 3 4 5 6 7 8 9 A B C D E F 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 2 9 4 215 0000 1101 0111 0 D 7
  • 16. Decimal to Binary Number = 36.37 5 Base = 2 Decimal Number Binary Digits Converter Number 0 0 0100100.0110 0.5 1 0100100.011 0.75 1 0100100.01 0.375 0 0100100.0 36 0 0100100 18 0 010010 9 1 01001 4 0 0100 2 0 010 1 1 01 0 0 0 Generete each digit by successive division Or multiplication. There is no guarantee the fraction will be finite Fractional part – Multiplication by base Whole part – divition by base
  • 17. Binary Additional 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 carry 1 Easy Layaou ?
  • 18. Binary Addition 190 + 141 =331 1 0 1 1 1 1 1 0 1 0 0 0 1 1 0 1 110 1 1 1 0 1 0 1 101 Carry out of 8-bit number 1 Carry out of Each column
  • 19. Binary Subtraction 229 – 46 = 183 1 1 1 0 0 1 0 1 0 0 1 0 1 1 1 0 1 1 2 1 1 2 10 1 2 1 2 1 1 2 101 Borrow out Borrow in from Left column A borrow-out of 1 from This column becomes a borrow in of 2 in this column Both rows subtracted
  • 20. Exercise Convert to 8-bit binary and do the arithmetic operation * 120 + 54 * 110 + 100 * 224 – 134 * 200 + 20 * 112 – 89 * 111 – 25 Convert back to decimal and check the result
  • 21. Binary Number Circle 4 – bit Binary Number Circle In real hardware there is a fixed number Of bits available. We often ignore leading zeros But they are still there! Examlpe : If we only use 4 bits then the binary Counting sequence “wraps around” At 15 ↔ 0 11 - 1 = 10 11 1011 - 1 1 10 1010
  • 22. Binary Number Circle 4 – bit Binary Number Circle Subtracting across the boundary Still “works” if you think of result As the distance on the number Circle. (Module arithmetic – ignore The borrow /carry) 8 1000 - 14 - 1110 10 (-1)1010
  • 23. Representing –ve Number Several choices for notation * sign + magnitude notation * 1’s complement * 2’s complement notation * various ‘excess codes ‘
  • 24. Sign Number – sign + magnitude Notation Sign Bit Magnitude 0  +ve Simple binary number 1  - ve Problem ? How about Null or Zero + 0  0000 - 0  1000
  • 25. Signed Numbers – Sign + magnitude Notation Arithmetic  Difficult to do – have to work out that operation to perform  5 + -6 actually calculate –(6-5) i.e. exchange the operands and do subtraction!  -5+ -6 actually calculate –(5+6) i.e. negate the addition of the negated numbers !  Required action depends the signs of the numbers and on which has the large magnitude. Natural for us –a bit hard for the computer since the only way it can work out the bigger number is to do a subtraction!
  • 26. Sign + Magnitude Examples Value 4-bit sign + magnitude 8-bit sign + magnitude +7 0111 00000111 +6 0110 00000110 …… …… …… +1 0001 00000001 +0 0000 00000000 -0 1000 10000000 -1 1001 10000001 -2 1010 10000010 …… …… …… -7 1111 10000111
  • 27. Sign Numbers – 2’s Complement  As for straight binary numbers but with the weighting of the most significant bit being negative  Example * 4 bit – weights are -8, 4,2,1 * 8 bit – weights are -128, 64,32,16,8,4,2,1  Need to know how many bits are being used to work out the value of the number – don’t omit leading zeroes
  • 28. Sign Numbers – 2’s Complement 1100.101 1 x 2-3 = 0.125 0 x 20 = 0.000 0 x 21 = 0.000 1 x 22 = 4.000 1 x 23 = -8.000 0 x 2-2 = 0.000 1 x 2-1 = 0.500 Binary point Sign Bit Binary, weightings are powers of 2 -4.375
  • 29. 2’s Complement Examples Value 4-bit sign 2’s complement 8-bit sign complement +7 0111 00000111 +6 0110 00000110 …… …… …… +1 0001 00000001 +0 0000 00000000 -1 1111 11111111 -2 1110 11111110 …… -8+berapa = bil -128+berapa = bil -7 1001 11111001 -8 1000 11111000
  • 30. 2’s Complement Examples (4 bit) Example : -4 (decimal) Become 4 = 0100 ( binary) = 1x22 = 4 2’s Complement -4= 1100 (binary) = -(23 ) + 22 = -8 + 4 = -4
  • 31. Exercise Converse decimal number above into negative (2’s complement) : 1. -7 ( 4 digit ) 6. 6 (4 digit) 2. -7 (8 digit) 7. 10 (8 digit) 3. -12 (8 digit) 8. 30 (8 digit) 4. -20 (8 digit) 9. 98 (digit) 5. -100 (8 digit) 10. 126 (digit)
  • 32. Addition 2’s Complement For 4 digit : 4 0100 3 + 0011 + 7 0111 22 +21 +20 = 4+2+1 =7
  • 33. Addition 2’s Complement For 4 digit -1 1111 -2 + 1110 + -3 11101 -(8)+4 +0 + 1 = -3 Carry out
  • 34. Exercise For 4 Digit : 1. 7 + (-5) 2. -6 + -1 3. 3 + 4 4. 2 + 3 5. -4 + 7 Converse all item to digital and addition. And then Converse to decimal again
  • 35. Subtraction 2’s Complement + 7 0111 + 3 (0011)- 1101 + +4 10100 Discard
  • 36. Subtraction 2’s Complement (-8) 1000 (-3) = 1101 - 0011 + -5 1011
  • 37. Exercise for 4 digit . Converse decimal above to digit and subtraction. After that converse to decimal again : 1. (+3) – (-3) 2. (-4) – (+2) 3. (-8)- (+4) 4. (-3) – (-4) 5. (7) – (5)
  • 38. 2’s Complement ALU  Addition and subtraction use the same rules as unsigned binary.  Same hardware may be used for both  Carry (C) is used for unsigned, overflow (v) for signed C=Carry V=overflow OP Signed Numbers Signed Numbers C=Carry V=overflow OP Signed Numbers Signed Numbers The same hardware Arithmetic Flags in Condition code register (CCR)