Attribution Non-Commercial (BY-NC)

171 views

Attribution Non-Commercial (BY-NC)

- JavaIOException
- cp2087 ultra chrome
- tcs32
- Sample Questions
- Number Systems
- News Wing (Issue 1)
- cse 1
- Chapter 1
- fsdfsdf fsdfdsfds sdfsdfsd sdfdsf
- floating point arithmetic
- Especificaciones_tecnicas_ACER
- Rugged Depot Brochure MK5
- HP Compaq 4000 Pro PC Compacta
- Number Systems
- Guide to TSOP IR Receiver-BOMM
- binario.pdf
- debug1214.txt
- Tutorial on Digital Integer Arithmetic
- Multiplier24x24 by Vedic Ta
- Digital I cap. 1

You are on page 1of 5

Week: Lecture Date: 06 12/03/2012

Ans: Ans:

Ans: Ans:

Course: Computer Fundamental Instructor: Dr. Arif Mushtaq Topic: Number Systems-1 Systems-

Ans: Ans:

A bit can take the values 0 or 1, thus it can describe 2 possibilities or can uniquely identify 2 things. Two bits can take the value 00, 01, 10, 11, thus it can describe four 22 possibilities or 2 can uniquely identify 4 things. n bits can encode 2 power n (2n possibilities).

Assume there are 400 students in this campus. If every student is to be assigned a unique bit pattern, what is the minimum number of bits required to do this? How many more students can be admitted to this campus without requiring additional bits for each students unique bit pattern?

What is the minimum number of bits required to represent the last four digits of your roll number? What is the minimum number of bits required to represent Pakistans population assuming it to be 160 million?

Information Representation

There are two types of information representation.

External representation Internal representation

External Representation:- of information is the way Representation:that how the information is represented by the humans and the way it is entered at a keyboard or displayed on a printer or screen. Internal Representation:- of information is the way Representation:it is stored in the memory of a computer or passed to any device of computer.

Number Systems

The on and off states of the capacitors in RAM can be thought of as the values 1 and 0, respectively. Therefore, thinking about how information is stored in RAM requires knowledge of the binary (base 2) number system. Lets review the decimal (base 10) number system first.

Number Systems

Decimal Number System

Base is 10 or D or Dec Ten symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Each place is weighted by the power of 10 Example: 123410 or 1234D = 1 x 103 + 2 x 102 + 3 x 101 + 4 x 100 = 1000 + 200 + 30 + 4

$1,000 $100 $10 $1

The decimal number system is a positional number system. Example:

Binary Number System

Base is 2 or b or B or Bin Two symbols: 0 and 1 Each place is weighted by the power of 2 Example: Example: 10112 or 1011 B = 1 x 23 + 0 x 22 + 1 x 21 + 1 x 20 = 8 + 0 + 2 +1 = 1110

11 in decimal number system is 1011 in binary number system

5 6 2 1

103 102 101 100

= 1 = 20 = 600 = 5000

Conversion from decimal number system to binary system

Question: represent 3410 in the binary number system Answer: using the divide-by-2 technique repeatedly

34

div-by-2

Example: 162:

162 / 2 81 / 2 40 / 2 20 / 2 10 / 2 5/2 2/2 1/2 = 81 = 40 = 20 = 10 =5 =2 =1 =0 rem 0 rem 1 rem 0 rem 0 rem 0 rem 1 rem 0 rem 1

17

div-by-2

8

div-by-2

4

div-by-2

2

div-by-2

1

div-by-2

Remainder

3410 1 x 25 + 0 x 24 + 0 x 23 + 0 x 22+ 1x 21 1000102

+ 0 x 20

Some Exercises

13D = (?) B 1101B 23D = (?) B

Conversion from binary number system to decimal system

Example: check if 1000102 is 3410 using the :weights appropriately

1000102 1 x 25 + 0 x 24 + 0 x 23 + 0 x 22+ 1 x 21 + 0 x 20

32 +

+ 0

+ 2

+ 0

3410

72D = (?) B

Some Exercises

Ex: 0101B

Bit 4 23 = 8

Addition

Bit 1 20 = 1

(?)D

Bit 3 22 = 4 Bit 2 21 = 2

1 4

0 +

1 1 = 5D

Ex: 1100B

(?)D

a 0 0 1 1

b 0 1 0 1

a+b 0 1 1 10

Carry bit

1 1 0 0 8 4 2 1 = 12D

0

128

(?)D

1

16

1 1 +

1 1 0 1b 0 1 0 1b 1 0 0 1 0b 1 1 1

1

64

0

32

1

8

1

4

0

2

0

1

If a = 15D, b = 10D

= 92D

1 1 1 1b + 1 0 1 0b 1 1 0 0 1b

Multiplication

a 0 0 1 1 b 0 1 0 1 axb 0 0 0 1

0101000010100111 = ?

Humans cant work well with binary numbers; there are too many digits to deal with. Memory addresses and other data can be quite large. Therefore, we sometimes use the hexadecimal number system.

Hexadecimal Number System

Base = 16 or H or Hex 16 symbols: { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A(=10), B(=11), C(=12), D(=13), E(=14), F(=15)}

Decimal to Hexadecimal

Example: Example: (829)10 = (? )16

Divide-by-16 829 / 16 51 / 16 3 / 16 Quotient 51 3 0 Remainder 13 3 3

Repeated division by 16

Hexadecimal to Decimal

(an-1an-2a1a0)16 = (an-1 x 16n-1 + an-2 x 16n-2 + + a1 x 161 + a0 x 160 )D Example: (1C7)16 = (1 x 162 + 12 x 161 + 7 x 160 )10

= (256 + 192 + 7)10 = (455)10

(33D)16

Hexadecimal Conversions

Hexadecimal to Binary

Expand each hexadecimal digit to 4 binary bits.

Example: (E29)16 = (1110 | 0010 | 1001)2

Binary: 1 0 1 0 0 0 0 1 0 1 0 0 1 1 12 Decimal: 2064710 Hexadecimal: 50A716 Notice how the number of digits gets smaller as the base increases.

Binary to Hexadecimal

Combine every 4 bits into one hexadecimal digit

Example: (0101 | 1111 | 1010 | 0110)2 = (5FA6)16

Practice Questions

1) Convert the following binary numbers to decimal numbers:

(a) (b) (c) (d) 0011 B 0101 B 0001 0110 B 0101 0011 B

Practice Questions

3) Convert the following binary/dec numbers to hexadecimal numbers:

(a) (b) (c) (d) (a) (b) (c) 0011 B 0101 B 0001 0110 B 0101 0011 B 21 D 731 D 1,023 D

(a) (b) (c) 21 D 731 D 1,023 D

4.) Perform the following binary additions and subtractions. Show your work without using decimal numbers during conversion.

(a) (b) 111 B + 101 B 1001 B + 11 B

Externally, computers do use decimal digits, sign/magnitude notations, and the familiar 26character alphabets. However, virtually every computer ever build stores data- numbers, letters, graphics-internally using the binary numbering system.

Memory

A bit is a single binary digit (a 1 or 0). A byte is 8 bits A word is 32 bits or 4 bytes Long word = 8 bytes = 64 bits Quad word = 16 bytes = 128 bits Programming languages use these standard number of bits when organizing data storage and access. What do you call 4 bits? (hint: it is a small byte)

A C

01000001

A

Screen

- JavaIOExceptionUploaded byWadeReynes
- cp2087 ultra chromeUploaded byorkdet
- tcs32Uploaded byjyothsna3
- Sample QuestionsUploaded bySeth Adjei
- Number SystemsUploaded byJenni Lorico
- News Wing (Issue 1)Uploaded byNews Wing
- cse 1Uploaded bySaaleh Amin
- Chapter 1Uploaded bySenan Alkaaby
- fsdfsdf fsdfdsfds sdfsdfsd sdfdsfUploaded byWajid Zachary
- floating point arithmeticUploaded byDarren Pinto
- Especificaciones_tecnicas_ACERUploaded byPentelRoot
- Rugged Depot Brochure MK5Uploaded byRay Collins
- HP Compaq 4000 Pro PC CompactaUploaded byGustavo Quintero
- Number SystemsUploaded bysullivan583
- Guide to TSOP IR Receiver-BOMMUploaded byfgaluppo
- binario.pdfUploaded byPedro Gutiérrez Álvarez
- debug1214.txtUploaded byAnas Rullah
- Tutorial on Digital Integer ArithmeticUploaded byRajesh Tiwary
- Multiplier24x24 by Vedic TaUploaded byAbhijeet Kumar
- Digital I cap. 1Uploaded byPriscilla Fernandes da Cruz
- PC5020 v3.0 Installation ManualUploaded byFranklin Jimenez
- Number Systems AdditionUploaded byMohsen Mzh
- Magellan Ep09Uploaded byNogy Arpad
- HPDesignjetEntry-levelPrintersServiceManualUploaded byinvisiblemank
- ncsdummy.pdfUploaded bykb5483
- Binary ShenanigansUploaded byNobody Actually
- lecture3and4_2_Fall17Uploaded byHassan Abbas
- PartitiontesUploaded byRhendy Tay
- 02-PLC[Forms of signal].pdfUploaded byMin Zayar
- Raghu Java ProgrammingUploaded byAbhishek Kumar Singh

- CF_Week 8 [Compatibility Mode]Uploaded bymusab1993
- CF_Week 7Uploaded bymusab1993
- CF_Week 5 [Compatibility Mode]Uploaded bymusab1993
- CF_Week 5Uploaded bymusab1993
- ITC_Lec 01Uploaded bymusab1993
- ITC_Lec 02Uploaded bymusab1993
- Computer Aided Design -Lecture 03Uploaded bymusab1993
- Computer Aided Design - Lecture 02Uploaded bymusab1993
- Computer Aided Design - Lecture 01Uploaded bymusab1993

- Interim Report FormatUploaded byPriya Tiwari
- Parental Satisfaction (Parents of Children 0-17, Elementary-high School)_0Uploaded bySergio Alejandro Blanes Càceres
- Malacology BookUploaded byCarlos Elias Altamar Bolibar
- Key Trends Hr 2016Uploaded byRama Aditya
- 008 ISO 10421998 Laboratory Glassware One Mark VolumUploaded byAri
- BBA III Year Project SampleUploaded byankushrocs
- MIS306 2014 Spring Syllabus Larson TUESUploaded bykickbackdate
- Solution Chapter8Uploaded byBunga Safhira Wirata
- Astronomy MagazineUploaded byAnca_books4life
- Righteous SolutionUploaded bybm1150gs
- Syllabus_ME100A_2016fall_10242016Uploaded bySean
- StructuralMechanicsModuleUsersGuide.pdfUploaded byArtemis Karvounis
- 48727127Uploaded byFadhil Adhhan
- E-Commerce evaluationUploaded byPankajKumar
- 146977Uploaded byXavier Salazar
- Why Data Cleaning is Important.pdfUploaded bymsfts.
- A Study on Effectiveness of Training ProgrammeUploaded byRoyal Projects
- Baisc Refrig and Air ConUploaded byGauntlet Roomes
- Transcripttoefllisteningtest 141031035206 Conversion Gate01Uploaded byAbdel Rahman Mohamed
- HSEB Physics SyllabusUploaded bysudantula
- Brick 702 - Equilibrium - LeChatelier_s Principle.pdfUploaded byrbgross
- A Brief History and Philosophy of PhysicsUploaded bygheorghe2
- Watkiss Vario Book Maker SysInfo Brochure EM FINAL LR PACKUploaded byshamilbasayev
- The Future of Sustainable DesignUploaded byrobbieansonduncan
- The Big Book of Near-Death Experiences (Notes)Uploaded byyonoid
- Formalities Need to Be Completed Before Joining WiproUploaded byAaron Jet
- Basic 65 ManualUploaded byakestecz
- Keele University Keele ISC Summary Prospectus 2013-14 LRUploaded byJoins 세계유학
- Balance and SymmetryUploaded byCarlos Abiera
- Ovonic Unified MemoryUploaded byphani98