Storage of Bits Computers represent information as patterns of bits

Slides:



Advertisements
Similar presentations
Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh
Advertisements

The Binary Numbering Systems
A digital system is a system that manipulates discrete elements of information represented internally in binary form. Digital computers –general purposes.
Chapter 1 Binary Systems 1-1. Digital Systems
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Assembly Language and Computer Architecture Using C++ and Java
Number Systems Standard positional representation of numbers:

Assembly Language and Computer Architecture Using C++ and Java
Number Systems Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16)
Chapter 1 Data Storage. 2 Chapter 1: Data Storage 1.1 Bits and Their Storage 1.2 Main Memory 1.3 Mass Storage 1.4 Representing Information as Bit Patterns.
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Dr. Bernard Chen Ph.D. University of Central Arkansas
1 Part I: Machine Architecture 4 A major process in the development of a science is the construction of theories that are confirmed or rejected by experimentation.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Programmable Logic Controllers
Simple Data Type Representation and conversion of numbers
Numbering systems.
Computers Organization & Assembly Language
Logic and data representation Revision. AND gate A B A B All inputs have to be true ( i.e 1) for the output of the gate to be high, in all other cases.
Computer Arithmetic Nizamettin AYDIN
IT253: Computer Organization
Data Representation and Computer Arithmetic
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Digital Logic Design Lecture 3 Complements, Number Codes and Registers.
Yuh-Jzer JoungDigital Systems1 Number Systems decimal number : 7397=7× × × ×10 0 a 4 a 3 a 2 a 1 a 0. a -1 a -2 = a 4 ×10 4 +a 3 ×10.
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
Data Representation Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.
ECEN 301Discussion #19 – Binary Numbers1 Numbered Moses 1:33,35,37 33 And worlds without number have I created; and I also created them for mine own purpose;
Number Systems and Codes. CS2100 Number Systems and Codes 2 NUMBER SYSTEMS & CODES Information Representations Number Systems Base Conversion Negative.
CPU Internal memory I/O interface circuit System bus
1 EENG 2710 Chapter 1 Number Systems and Codes. 2 Chapter 1 Homework 1.1c, 1.2c, 1.3c, 1.4e, 1.5e, 1.6c, 1.7e, 1.8a, 1.9a, 1.10b, 1.13a, 1.19.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
Computer Math CPS120 Introduction to Computer Science Lecture 4.
Tutorial: ITI1100 Dewan Tanvir Ahmed SITE, UofO
Monday, January 14 Homework #1 is posted on the website Homework #1 is posted on the website Due before class, Jan. 16 Due before class, Jan. 16.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
MECH1500 Chapter 3.
DIGITAL SYSTEMS Number systems & Arithmetic Rudolf Tracht and A.J. Han Vinck.
Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Logic Design EE-2121 Manesh T. Digital Systems  Introduction  Binary Quantities and Variables  Logic Gates  Boolean Algebra  Combinational Logic.
Number Representation and Arithmetic Circuits
1 Ethics of Computing MONT 113G, Spring 2012 Session 4 Binary Addition.
Computer Math CPS120 Introduction to Computer Science Lecture 7.
Materials on the Exam Introduction Data Representation in Computer Systems Boolean Algebra Digital Logic MARIE: An Introduction to a Simple Computer Until.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
N 3-1 Data Types  Binary information is stored in memory or processor registers  Registers contain either data or control information l Data are numbers.
Chapter 1: Data Storage.
CS2100 Computer Organisation
Chapter 1 Digital Systems and Binary Numbers
Computer Science: An Overview Eleventh Edition
Introduction to Chapter 2
University of Gujrat Department of Computer Science
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
INTRODUCTION TO LOGIC DESIGN Chapter 1 Digital Systems and Binary Numbers gürtaçyemişçioğlu.
Chapter 1 Data Storage.
Data Representation Data Types Complements Fixed Point Representation
UNIT – 3 & 4. Data Representation and Internal
Presentation transcript:

Storage of Bits Computers represent information as patterns of bits A bit (Binary Digit) is one of the two digits 0 or 1 Storing a bit in the machine requires a device that can be in one of two states:On or Off , True or False , 0 or 1

GATES AND FLIP-FLOPS There are several gates that perform logical operations The basic gates are: AND OR EXLUSIVE-OR(X-OR) NOT

AND Gate Logic Circuit A Y B Truth Table A B Y 0 0 0 0 1 0 1 0 0 1 1 1 0 0 0 0 1 0 1 0 0 1 1 1 Logic Equation Y= A.B

OR Gate A Y B Logic Circuit Truth Table A B Y 0 0 0 0 1 1 1 0 1 1 1 1 0 0 0 0 1 1 1 0 1 1 1 1 Logic Equation: Y = A + B

Exclusive OR (X-OR) A Y B Logic Circuit Truth Table A B Y 0 0 0 0 1 1 0 0 0 0 1 1 1 0 1 1 1 0 Logic Equation Y = A + B

NOT Gate A Y Logic Circuit Truth Table A Y 0 1 1 0 Logic Equation Y= A

NAND Gate A B Y

NOR Gate A B Y

Example(1) Draw the logic circuit and find the truth table for the following logic equation: X=(A+B)C A B C X 0 0 0 0 A B C X

Example(1) Draw the logic circuit and find the truth table for the following logic equation: 1 X=(A+B)C A B C X 0 0 0 0 0 0 1 0

Example(1) Draw the logic circuit and find the truth table for the following logic equation: 1 X=(A+B)C A B C X 0 0 0 0 0 0 1 0 0 1 0 0

A B C X 1 No. of States = 2No. Of Inputs X=(A+B)C A B C X 0 0 0 0 Example(1) Draw the logic circuit and find the truth table for the following logic equation: A B C X 1 No. of States = 2No. Of Inputs X=(A+B)C A B C X 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1

FLIP - FLOP A flip-flop is a circuit that has one of two output values; its output remains fixed until a temporary pulse from another circuit causes it to shift to other value The significance of a flip-flop is that it stores the information There are several kinds of flip flops like: J-K flip-flop , S-R flip-flop, D flip-flop , T flip-flop

J-K Flip-flop J K Q J-K Flip-flop Logic Circuit CK 1

J-K Flip-Flop J-K F-F J K CK Q Truth Table : J K Qn Qn+1 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 J-K F-F J K CK Q J-K Symbol No Change Reset Set Toggle

Numbering Systems Decimal System Binary System Octal System Hexadecimal System Decimal System Consists of 10 digits 0,1,2,3,4,5,6,7,8,9 The base for this system is 10 To analyze any decimal number: 652= 102x6 + 101x5 + 100x2 = 600 + 50 + 2 = 652

Binary System Consists of two digits 0 and 1 The base for the binary system is 2 It is the system used to represent information inside the computer system It is important to be familiar with conversion methods between the different numbering systems

Binary System Decimal -to- Binary conversion: To convert (8)10from decimal to binary: 2 8 (8)10=(1000)2 2 4 0 LSB 2 2 0 2 1 0 2 0 1 MSB

Binary System Binary -to- Decimal Conversion: Convert (1011)2 into decimal number: 23x1 + 22x0 + 21x1 + 20x1= 8 + 0 + 2 + 1 = (13)10

Octal System Consists of 8 digits: 0,1,2,3,4,5,6,7 The base for the octal system is 8 It has many applications in information coding systems

Octal System Decimal -to- Octal Conversion: To convert (13)10 into Octal number: (13)10=(15)8 8 13 8 1 5 0 1 Octal -to- Decimal Conversion: (15)8= 81x1 + 80x5= 8 + 5 = (13)10

Hexadecimal System It consists of 16 digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F The base for hexadecimal system is 16 It is commonly used to describe all the information in the computer system(the information represented as binary numbers and described by hexadecimal system)

Hexadecimal System Decimal -to- Hexadecimal Conversion: Convert(302)10 into Hexadecimal notation: 16 302 (302)10=(12E)16 16 18 14 16 1 2 16 0 1

Hexadecimal System Hexadecimal -to- Decimal Conversion: (A4B)16= 162x10 + 161x4 + 160x11= 2560 + 64 + 11 =(2575)10

Hexadecimal System Hexadecimal -to- Binary: Binary -to- Hexadecimal: (10001001011111)2=( ? )16 2 2 5 F

Fractions Decimal -to-Binary: Result Carry (3.5)10=11.? 0.5x2=1.0 0.0 1 =11.1 1x2-1 (0.6)10= 0.6x2= 0.2 1 =(0.10011)2 0.2x2= 0.4 0 0.4x2= 0.8 0 1x2-1+1x2-4+1x2-5= 0.8x2= 0.6 1 0.5+0.0625+0.3125= 0.6x2= 0.2 1 0.59375 Round-off Problem

Storing Integers: 1. Excess Notation: It is easy to distinguish the patterns that represent negative values from those do not. Those that represent negative values have a 0 as their most significant bit, while those do not represent negative values have a 1 as their MSB. The MSB is often called Sign Bit

1)Excess Notation: The following is 3-bit , excess-4 notation: Bit Pattern Value represented 111 + 3 110 + 2 101 + 1 100 0 011 - 1 010 - 2 001 - 3 000 - 4

2) Two’s Complement Notation A notation used to represent both positive and negative integers It simplifies the arithmetic operations, such as Addition and Subtraction , and then Multiplication and Division By using this notation, the subtraction operation can be done in similar way the addition performed

Two’s Complement: To obtain two’s complement of a decimal number, for example ( 5 ): Get the binary value 101, and to represent that this is a positive number, put a leading 0 as MSB 0101 Get the 1’s complement of the above value by inverting each digit: 0101 1010 Add 1 to the result to get + 1 ------------- 2’s Complement 1011

Two’s Complement: Example 0011 1100 1101 Perform 5 - 3. Sol. Can be performed as 5 + (-3) using 2’s complement notation: 0101 1101 2’s complement of 3 ------- + 1 0010 The result(+2) Dropped

3) Floating- Point Notation: A notation used to represent very large or very small positive and negative numbers Consists of byte. The MSB represents sign bit. 0 for positive and 1 for negative The other bits divided as: 8 7 6 5 4 3 2 1 Sign Exponent Mantissa Bit

Floating-Point Notation: To convert 3 1/2 into F.P notation: 1) The number is +ve, the sign bit is 0 2) (3 1/2)10 is (11.1)2 , to represent it in F.P the radix should be shift left two places, the value becomes .111(which is the mantissa) and the exponent is 2 3) Convert the exponent into excess-4 form by adding 4 to it (which results 6) and convert it into binary 110 (which is the exponent part) 4) The resulting F.P number is(01101110)

Floating-Point Notation: Convert (10110101) from F.P notation into decimal number: 1) Sign bit 1 , the No. is negative 2)The exponent is 011 which is 3 ,subtract 4 from it results (-1). This means the radix should be shift left one place. 3)The mantissa is .0101 the radix shifted one place left, the resulted value is (00101) which is 1/8 + 1/32 = 5/32 4)The resulted decimal value is - (5/32)

Memory System For purpose of storing data, a computer contains a large collection of circuits, each capable of storing a bit. The computer system contains two main types of memory: Main Memory Secondary Memory(Mass Storage)

Main Memory: The storage circuits in a machine’s main memory are arranged in manageable units called cells(or words) , with a typical cell size being 8 bits Every 8 bits are called byte Every 1024 bytes called kilobyte(210 KB), and each 1024 KB is Megabyte … The main memory is divided to: Random Access Memory(RAM) Read Only Memory(ROM)

Mass Storage: Secondary storage is a cheap and very large (huge amount) storage area It is a permanent storage Classified into: Tapes Disks Compact Disks (CDs)

Communication Errors: During the data transmission between two points, we may lose data. To resolve such a problem, a variety of error detection and error correction techniques have been developed such as: Parity Bit Cyclic Redundancy Check(CRC) Hamming Distance

Parity Bit: It is a bit added as MSB used to detect errors without correcting them. Is based on the principle that if each bit pattern being manipulated has an odd number of 1’s (Odd Parity)and a pattern found with an even number of 1’s (Even Parity) This is achieved by adding an extra bit for parity check. Thus an ASCII of 8 bits becomes 9 bits

Parity Bit: To obtain the odd parity for character(A): 1) From ASCII table,the hex code of A is 41, in binary is : 0100 0001 2) Since the number of 1’s in the code is even. The odd parity bit must be 1 to get odd number of 1’s, and the complete code becomes: 1 0100 0001 3)If an error happened in 3rd bit from right ,the received character becomes: 1 0100 0101 , the number of 1’s is even, so the receiver detect that an error has been occurred

Parity Bit: 4) This method is used to detect single error and never correct it 5) It fails to detect the error if it happens in the parity bit itself