data

© All Rights Reserved

47 views

data

© All Rights Reserved

- Digital Electronics & Computer Fundamentals theory.
- Raghu Sir Programs
- Excel Convert
- Chapter 1 _ Number System a.
- bolum1cozumler
- Yiddish
- Rbs Datalink File Spec Iso8583 Format 9
- Development of the Binary Number System and the Foundations of Computer
- Discrete
- Binary Numbers
- Myodesie.com-programmable Logic Controller Plc
- Cat
- Introduction of Computers
- 08.Digital Introduction.pdf
- Cpphtp5 AppD IM
- Comp Arithm
- Magana_Experiment1_CPE103L
- Digital logic lesson
- Decimal to BCD Convetor
- Binary2BCD

You are on page 1of 50

Type Data

1.

2.

3.

dapat diklasifikasikan sebagai salah satu dari

kategori berikut:

angka yang digunakan dalam perhitungan

aritmatika,

huruf-huruf alfabet yang digunakan dalam

pengolahan data, dan

simbol diskrit lain yang digunakan untuk tujuan

tertentu.

komputer dalam bentuk kode-biner.

Representasi Radix

Radix atau basis: adalah jumlah

simbol yang digunakan untuk mewakili

nilai. Sebuah sistem jumlah radix r

menggunakan string yang terdiri dari

simbol r yang berbeda untuk mewakili

nilai.

Radix representation of

numbers

the radix 10 format. 97654.35

The positions indicate the power of the radix.

Start from the decimal point right to left we get

0,1,2,3,4 for the whole numbers.

And from the decimal point left to right

We get -1, -2 for the fractions

= 9x104 + 7x103 + 6x102 + 5x101 + 4x100 + 3x10-1 +

5x10-2

Binary Numbers

digits (bits):

0 and 1

(1011)2 = 1x23 + 0x22 + 1x21 + 1x20 =

(11)10

Example

decimal.

The position value is power of 2

1.

22

21

20

2-1

2-2

1 x 22 + 0 x 2 + 1 + 0 x 2-1 + 1 x 2-2

4+

0+

1+

0+

1/22 = 5.25

(101.01)2 (5.25)10

Binary Addition

Example Add (11110)2 to

(10111)2

1 1 1 1

1 1 1 0 1

+

1 0 1 1 1

--------------------1 0 1 0 1 0 0

carry

(111101)2 + (10111) 2 = (1010100)2

1

1

1

carries

Binary Subtraction

Example: subtract (10111) from (1001101)

1

0 10 10

1

1+1=

2

10

0 0 10

0 1 1 0 1

1 0 1 1 1

-----------------------0 1 1 0 1 1 0

(1001101)2 - (10111)2 = (0110110)2

borrows

n

0

1

2n

20=1

21=2

2

3

4

5

22=4

23=8

24=16

25=32

6

7

26=64

27=12

8

n

8

2n

28=256

9

10

29=512

210=102

4

211=204

8

212=409

6

220=1M

230=1G

240=1T

11

12

20

30

40

Mega

Giga

Tera

Octal Numbers

(0,1,2,3,4,5,6,7)

How many items does an octal number represent?

Convert the following octal number to decimal

(465.27)8 = 4x82 + 6x81 + 5x80 + 2x8-1 + 7x8-2

Counting in Octal

0

10 11 12 13 14 15 16 17

20 21 22 23 24 25 26 27

Octal(base 8)

Decimal(base 10)

Binary(base 2)

Hexadecimal

decimal number system.

systems

(base16)

1. Divide the decimal number by the base (e.g. 2)

2. The remainder is the lowest-order digit

3. Repeat the first two steps until no divisor

remains.

4. For binary the even number has no remainder

0, while the odd has 1

Another Base

Integer

Quotient

13/2 =

6/2 =

3/2 =

1/2 =

Remainder

(12+1)

( 6+0 )

(2+1 )

(0+1)

Coefficient

a0 = 1

a1 = 0

a2 = 1

a3 = 1

to Another Base

For each digit position:

1. Multiply decimal number by the base (e.g. 2)

2. The integer is the highest-order digit

3. Repeat the first two steps until fraction becomes zero.

to Another Base

Integer

0.625 x 2 =

0.250 x 2 =

0.500 x 2 =

1

0

1

Fraction

+

+

+

0.25

0.50

0

Coefficient

a-1 = 1

a-2 = 0

a-3 = 1

(INTEGER+FRACTION)

(1) Separate the decimal number into integer and fraction parts.

(2) Repeatedly divide the integer part by 2 to give a quotient and a

remainder and

Remove the remainder. Arrange the sequence of remainders

right to left from the period. (Least significant bit first)

(3) Repeatedly multiply the fraction part by 2 to give an integer

and a fraction part

and remove the integer. Arrange the sequence of integers left

to right from the period. (Most significant fraction bit first)

Integer = 41, Fraction = 0.6875

Integer

41

/2

20

10

5

2

1

remainder

1

0

0

1

0

1

Closer to

the point

Overflow

Fraction

X by 2

.6875

.3750

.750

.5

41 = 32+8+1

= 1 x 25 + 0 x 24 + 1 x 23 + 0 x 22 + 0 x 2 + 1 = (101001)

Decimal to Octal

For each digit position:

1. Divide decimal number by the base (8)

2. The remainder is the lowest-order digit

3. Repeat first two steps until no divisor remains.

Decimal to Octal

Example for (175)10:

Integer

Quotient

175/8 =

21/8 =

2/8 =

21

2

0

Remainder

+

+

+

7/8

5/8

2/8

Coefficient

a0 = 7

a1 = 5

a2 = 2

Decimal to Octal

For each digit position:

1. Multiply decimal number by the base (e.g. 8)

2. The integer is the highest-order digit

3. Repeat first two steps until fraction becomes

zero.

Decimal to Octal

Example for (0.3125)10:

Integer

0.3125 x 8 =

0.5000 x 8 =

2

4

+

+

Fraction

Coefficient

0.5

0

a-1 = 2

a-2 = 4

Combine the two (175.3125)10 = (257.24)8

Remainder

of division

Overflow of

multiplication

Hexadecimal Numbers

with four bits.

(0,1,2,3,4,5,6,7,8,9,A, B, C, D, E, F)

(1110) 2 = (E)16

(1110) 2

Example

(107.00390625)10 into hexadecimal number.

Integer

remainde

r

107

Divide/16

11=B

Closer to

.

the period

Overflow

Fraction

X by 16

.

00390625

.0625

.0000

(107.00390625)10 (6B.01)16

hexadecimal similar

Easy to build circuits to

operate on these

representations

Possible to convert

between the three

formats

Base 2

3A9F16 = 0011 1010 1001 11112

3

Conversion is easy!

Determine 4-bit value for each hex digit

four bits which means each 16 value is

converted to four binary bits.

Base 8

3A9F16 = 0011 1010 1001 11112

3

352378 =

3

2. Regroup bits into groups of three starting from right

3. Ignore leading zeros

4. Each group of three bits forms an octal digit (8 is

represented by 3 binary bits).

Example

Convert 101011110110011 to

a.

octal number

b. hexadecimal number

a.

(101) (011) (110) (110) (011)

5

3

6

6

3

101011110110011 = (53663)8

b. Each 4 bits are converted to hexadecimal:

(0101) (0111) (1011) (0011)

5

7

B

3

101011110110011 = (57B3)16

Conversion from binary to hexadecimal is similar except that the bits

divided into groups of four.

with four bits

Ex. 0011 0010 1001 = 32910

3

Why use binary coded decimal? Because people think in

decimal.

Digit

BCD Code Digit

BCD Code

0

1

2

3

4

0000

0001

0010

0011

0100

5

6

7

8

9

0101

0110

0111

1000

1001

Used in early

computers (40s, 50s)

Used to encode

numbers for sevensegment displays.

Easier to read?

(Example)

The decimal 99 is represented

by 1001 1001.

Gray Code

Digit

Binary

Gray Code

0000

0000

0001

0001

0010

0011

0011

0010

0100

0110

0101

0111

0110

0101

0111

0100

1000

1100

1001

1101

10

1010

1111

11

1011

1110

12

1100

1010

13

1101

1011

14

1110

1001

15

1111

1000

number system.

It is an alternative

way to represent four

bit data

Only one bit changes

from one decimal digit to

the next

Useful for reducing

errors in communication.

Can be scaled to larger

numbers.

ASCII Code

ASCII is a 7-bit code, frequently used with an 8th bit for

error detection (more about that in a bit).

Character ASCII (bin) ASCII

(hex)

Decimal

Octal

1000001

41

65

101

1000010

42

66

102

1000011

43

67

103

Z

a

Complements

Conventional addition (using carry) is easily

implemented in digital computers.

However; subtraction by borrowing is difficult

and inefficient for digital computers.

Much more efficient to implement subtraction

using ADDITION OF the COMPLEMENTS of

numbers.

Complements of numbers

(r-1 )s Complement

Given a number N in base r having n digits,

the (r- 1)s complement of N is defined as

(rn - 1) - N

For decimal numbers the

base or r = 10 and r- 1= 9,

so the 9s complement of N

is

(10n-1)-N

99999. - N

Digit

n

Digit

n-1

Next

digit

Next

digit

First

digit

9s complement Examples

453299

and the 9s complement of 12389 is

99999- 12389 = 87610.

ls complement

For binary numbers, r = 2 and r 1 = 1,

r-1s complement is the ls complement.

The ls complement of N is (2n - 1) - N.

Bit n-1

Bit n-2

Bit 1

Bit 0

Digit

n

Digit

n-1

Next

digit

Next

digit

First

digit

ls complement

Find r-1 complement for binary number N with four binary digits.

r-1 complement for binary means 2-1 complement or 1s complement.

n = 4, we have 24 = (10000)2 and 24 - 1 = (1111)2.

The ls complement of N is (24 - 1) - N. = (1111) - N

ls complement

The complement 1s of

1011001 is 0100110

The 1s complement of

0001111 is 1110000

rs Complement

Given a number N in base r having n digits,

the rs complement of N is defined as

rn - N.

For decimal numbers the

base or r = 10,

1

is

10n-N.

100000. - N

Digit

n

Digit

n-1

Next

digit

Next

digit

First

digit

Find the 10s complement of

546700 and 12389

The 10s complement of 546700

is 1000000 - 546700= 453300

12389 is

100000 - 12389 = 87611.

Notice that it is the same as 9s

complement + 1.

2s complement

For binary numbers, r = 2,

rs complement is the 2s complement.

The 2s complement of N is 2n - N.

Digit

n

Digit

n-1

Next

digit

Next

digit

First

digit

2s complement Example

1

The 2s complement of

1011001 is 0100111

The 2s complement of

0001111 is 1110001

Complement

Method 1:

The 2s complement of binary number is obtained by adding 1 to the

ls complement value.

Example:

1s complement of 101100 is 010011 (invert the 0s and 1s)

2s complement of 101100 is 010011 + 1 = 010100

Complement

Method 2:

The 2s complement can be formed by leaving all least significant 0s

and the first 1 unchanged, and then replacing ls by 0s and 0s by ls

in all other higher significant bits.

Example:

The 2s complement of 1101100 is

0010100

Leave the two low-order 0s and the first 1 unchanged, and then

replacing 1s by 0s and 0s by 1s in the four most significant bits.

Examples

Finding the 2s complement of (01100101)2

add 1 to the result.

(01100101)2

[N] = 2s complement = 1s complement (10011010)2 +1

=(10011011)2

copy all the bits up to and including the first 1 bit

and then complement the remaining bits.

N

[N]

=01100101

=10011011

using rs complement

Subtract N from M :

MN

rs complement

add M to ( rn N ) :

(rn N )

Sum = M + ( r n N)

sign will produce an end carry rn we need to

take the rs complement again.)

using rs complement

(1) if M N, ignore the carry without taking

complement of sum.

(2) if M < N, take the rs complement of

sum and place negative sign in front of

sum. The answer is negative.

perform the subtraction 72532 - 13250 = 59282.

M > N : Case 1 Do not take complement of sum

and discard carry

The 10s complement of 13250 is 86750.

Therefore:

M=

72532

10s complement of N =+86750

Sum=

159282

Discard end carry 105= - 100000

Answer = 59282

no complement

Example 2;

Now consider an example with M <N.

The subtraction 13250 - 72532 produces negative 59282. Using

the procedure with complements, we have

M = 13250

10s complement of N = +27468

Sum = 40718

Take 10s complement of Sum

100000

-40718

The number is :

59282

- Digital Electronics & Computer Fundamentals theory.Uploaded byRaju Ali Kawsar
- Raghu Sir ProgramsUploaded byzcvv
- Excel ConvertUploaded byfmsIII_clan
- Chapter 1 _ Number System a.Uploaded bya1a2n3c4h5a6l7
- bolum1cozumlerUploaded bysherryjwoodley
- YiddishUploaded byAbraham Shapiro Perfil Dois
- Rbs Datalink File Spec Iso8583 Format 9Uploaded byKrishna Telgave
- Development of the Binary Number System and the Foundations of ComputerUploaded bysaturn1358
- DiscreteUploaded byFidelRomasanta
- Binary NumbersUploaded byapi-3823177
- Myodesie.com-programmable Logic Controller PlcUploaded byokk chu
- CatUploaded byVikas Babu
- Introduction of ComputersUploaded byRAGHUBALAN DURAIRAJU
- 08.Digital Introduction.pdfUploaded byMd Arif
- Cpphtp5 AppD IMUploaded byClaudio De Conti
- Comp ArithmUploaded byShahAyzdii
- Magana_Experiment1_CPE103LUploaded byThayja Rae Opiana Magana
- Digital logic lessonUploaded byazmaloney7
- Decimal to BCD ConvetorUploaded byHectorLopez
- Binary2BCDUploaded byNguyễn Long
- 02-Data Representation ViewUploaded byBabatope Adeniyi
- ejercicios inglés repasoUploaded byMorgannaLeFair
- INVENTARIO NUEVOUploaded byjimbrian55
- EnglishUploaded byezequiel
- Compute IT2 Scheme of WorkUploaded byJK EduNotes
- Level_12_Antonyms_1.pdfUploaded bysonu
- UNIT-1 DLD new11.docxUploaded bykusuma
- links-xUploaded byidiooo
- Luke Number Final Assess Oct 2010Uploaded by18lukeh
- IGA_1_2_2017_8_16_5_287 (1)Uploaded byGeoff

- 67187Uploaded byVijay
- Engineering Design ET ZC413Uploaded byssanthosh073
- Entrepreneurial CompetenciesUploaded byshanumanuranu
- tems_discovery_network_10.0_datasheet.pdfUploaded byRaphael de Oliveira
- A Multi-objective Planning Framework for Analysing the Integration of Distributed Energy ResourcesUploaded byartu_alarcon78
- 2.-Musolff Metaphor and SymbolUploaded byecartetescuisses
- geit-40041_rhythm_archive_en_12_2014__0Uploaded bysridharskr
- 1.4812065_rolling_friccion_dem.pdfUploaded byDibujantes Proyectistas
- 2007_NVH_str_borne_workshop_aai_alan duncan.pdfUploaded byMahesh Sb
- research paperUploaded byapi-405689767
- Sample Formal ReportUploaded byfasih
- As 1288-2006 Amdt 1-2008 Glass in Buildings - Selection and InstallationUploaded byRichard Santoso Wiriyanto
- The Aerodynamics of Hovering Insect Flight - 3 KinematicsUploaded byMary Lum
- Contract AdministratorUploaded byapi-121423732
- EXAMPLE EXPANATION TEXT.docxUploaded byAbu
- Dictionary of Marine TechnologyUploaded byClaudiu Pândaru
- x737 ReadMe&Manual.pdfUploaded byCapiZolano
- Section7[1]Uploaded byWisit Best
- HIBBETT Et Al. - 2007 - A Higher-level Phylogenetic Classification of the FungiUploaded byBianca Silva
- irc3380_2880-pcUploaded byAndrei Marinas
- Propositional Logic (discrite maths)Uploaded byapi-33642484
- Constructor and Destructor in C#Uploaded byRi Cky
- Resume.docxUploaded byAnonymous TODjsjguo
- 12 Chakra SystemUploaded bysomewhereone
- How Castle Vale Community Housing Association use ConnectUploaded byCharlotte Blackburn
- The Feng Shui Compass and Its Use - Luo PanUploaded byKiyanka Nastya
- Form Return User Guide 1.3.1Uploaded bySoleh Asgar
- agilescrum.docxUploaded byBala Chandar
- Chapter 14 - Controlling User AccessUploaded byS M Akash
- Krafft a. Ehricke - The Anthropology of AstronauticsUploaded bymattoro