23
CLICK HERE Welcome To Our Courseware

BITS,BINARY AND LOGIC

Embed Size (px)

Citation preview

Page 1: BITS,BINARY AND LOGIC

CLICK HERE

Welcome To Our Courseware

Page 2: BITS,BINARY AND LOGIC

LOADING…….

Page 3: BITS,BINARY AND LOGIC

FLOATING POINT

1’s & 2’s Complimen

t

LOGIC OPERATIONS

HEXADECIMAL

E-LEARNING CENTER

CONVERTING

CHOOSE YOUR TOPIC

Page 4: BITS,BINARY AND LOGIC

CONVERTING

Binary to Decimal

Decimal to Binary

Binary to Hexadecimal

CHOOSE YOUR TOPIC

MAIN MENU

Page 5: BITS,BINARY AND LOGIC

LOGIC OPERATIONS

AND GATE

ADDITION

OR GATE

SUBRACTION

CHOOSE YOUR TOPIC

MAIN MENU

Page 6: BITS,BINARY AND LOGIC

0 0111 100

UNSIGNED INTEGER

CONVERTING LOGIC OPERATION EXITMAIN MENU

Page 7: BITS,BINARY AND LOGIC

1’S COMPLIMENT

L PIF 0 0111 100

UNSIGNED INTEGER

CONVERTING LOGIC OPERATION EXITMAIN MENU

CLICK HERE TO 2’COMPLIMENT

Page 8: BITS,BINARY AND LOGIC

11 100

+

1’S COMPLIMENT

2’S COMPLIMENT

0 011UNSIGNED INTEGER

CONVERTING LOGIC OPERATION EXITMAIN MENU

Page 9: BITS,BINARY AND LOGIC

0 1 1 0

2023

22 21

Mostsignificant

Leastsignificant

n 2n

0 1

1 2

2 4

3 8

4 16

5 32

6 64

7 128

8 256

9 512

10 1024

CONVERTING LOGIC OPERATION EXITMAIN MENU

Page 10: BITS,BINARY AND LOGIC

1 1

=

2023 22 21 +++

4 2+

6=

0 0

0 1 1 0

202322 21

ONLY 1 (CIRCLE) WAS COUNT

BACK TO CONVERTING MENU

Page 11: BITS,BINARY AND LOGIC

663

22

01

12 1

00110

READ FROM DOWN TO UP

CONVERTING LOGIC OPERATION EXITMAIN MENU

Page 12: BITS,BINARY AND LOGIC

1 010

0 100+SIGNED

INTEGER

ANSWER

1 100SIGNED INTEGER

CONVERTING LOGIC OPERATION EXITMAIN MENU

Page 13: BITS,BINARY AND LOGIC

10 010

+

1’S COMPLIMENT

2’S COMPLIMENT

1 101NEGATIVE INTEGER

CONVERTING LOGIC OPERATION EXITMAIN MENU

Page 14: BITS,BINARY AND LOGIC

1 0001 011

-1

ANSWER

1 1005

CONVERTING LOGIC OPERATION EXITMAIN MENU

Page 15: BITS,BINARY AND LOGIC

1 0111 011

OR

ANSWER

1 010

ORuseful for setting bitsOR with zero = no changeOR with one = 1

Page 16: BITS,BINARY AND LOGIC

1 0001 000

AND

ANSWER

1 110

ANDuseful for clearing bitsAND with zero = 0AND with one = no change

Page 17: BITS,BINARY AND LOGIC

• It is often convenient to write binary (base-2) numbersas hexadecimal (base-16) numbers instead.– fewer digits -- four bits per hex digit– less error prone -- easy to corrupt long string of 1’s

and 0’s

HEXADECIMAL NOTATION

CONVERTING LOGIC OPERATION EXITMAIN MENU

Page 18: BITS,BINARY AND LOGIC

Binary Hex Decimal

0000 0 0

0001 1 1

0010 2 2

0011 3 3

0100 4 4

0101 5 5

0110 6 6

0111 7 7

Binary Hex Decimal

1000 8 8

1001 9 9

1010 A 10

1011 B 11

1100 C 12

1101 D 13

1110 E 14

1111 F 15

HEXADECIMAL NOTATION

CONVERTING LOGIC OPERATION EXITMAIN MENU

Page 19: BITS,BINARY AND LOGIC

Every four bits is a hex digit.– start grouping from right-hand side– Is refer to hexamdecimal table

1101 0001 1010 1111

FA1D

HEXADECIMAL NOTATION

CONVERTING LOGIC OPERATION EXITMAIN MENU

Page 20: BITS,BINARY AND LOGIC

• Large values: 6.023 x 1023 -- requires 79 bits• Small values: 6.626 x 10-34 -- requires >110 bits

• Use equivalent of “scientific notation”: F x 2E

• Need to represent F (fraction), E (exponent), and sign.• IEEE 754 Floating-Point Standard (32-bits):

S Exponent Fraction

1b 8b 23b

0exponent,2fraction.0)1(

254exponent1,2fraction.1)1(126

127exponent

S

S

N

N

FLOATING POINT

Page 21: BITS,BINARY AND LOGIC

00101000.101 (40.625)

+ 11111110.110 (-1.25)

00100111.011 (39.375)

2-1 = 0.52-2 = 0.252-3 = 0.125

How can we represent fractions?Use a “binary point” to separate positivefrom negative powers of two -- just like “decimal point.”2’s comp addition and subtraction still work.

if binary points are aligned

CONVERTING LOGIC OPERATION EXITMAIN MENU

Page 22: BITS,BINARY AND LOGIC

2-22

Single-precision IEEE floating point number:

1 01111110 10000000000000000000000

sign exponent fractionSign is 1 – number is negative.Exponent field is 01111110 = 126 (decimal).Fraction is 0.100000000000… = 0.5 (decimal).

Value = -1.5 x 2(126-127) = -1.5 x 2-1 = -0.75.

FLOATING POINT

Page 23: BITS,BINARY AND LOGIC

Thank you, see you again