Data Storage and manipulation. Data Storage Computers store and manipulate data in the form of electronic pulses (high and Low voltages). This digitised.

Slides:



Advertisements
Similar presentations
Princess Sumaya Univ. Computer Engineering Dept. د. بســام كحـالــه Dr. Bassam Kahhaleh.
Advertisements

HEXADECIMAL NUMBERS Code
A digital system is a system that manipulates discrete elements of information represented internally in binary form. Digital computers –general purposes.
Chapter 2 : Number System
Digital Fundamentals Floyd Chapter 2 Tenth Edition
2-1 Computer Organization Part Fixed Point Numbers Using only two digits of precision for signed base 10 numbers, the range (interval between lowest.
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
Data Representation in Computers
Digital Fundamentals Floyd Chapter 2 Tenth Edition
CODING SYSTEMS CODING SYSTEMS CODING SYSTEMS. CHARACTERS CHARACTERS digits: 0 – 9 (numeric characters) letters: alphabetic characters punctuation marks:
1.6 Signed Binary Numbers.
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
Number Systems and Codes
Data Representation in Computers
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Programmable Logic Controllers
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
Binary Arithmetic & Data representation
Binary Codes. Binary Code A binary code is just an assignment of information to bit patterns.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Digital Logic Design Lecture 3 Complements, Number Codes and Registers.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
Introduction to Computer Design CMPT 150 Section: D Ch. 1 Digital Computers and Information CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU 1.
CS151 Introduction to Digital Design
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
Number systems & Binary codes MODULE 1 Digital Logic Design Ch1-2 Outline of Chapter 1  1.1 Digital Systems  1.2 Binary Numbers  1.3 Number-base Conversions.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Computer Systems Architecture Copyright © Genetic Computer School 2008 CSA 1- 0 Lesson 1 Number System.
Summer 2012ETE Digital Electronics1 Binary Arithmetic of Signed Binary Numbers.
Complements and Codes by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano  Programmable Controllers-Theory and Implementation,
1 Representation of Data within the Computer Oct., 1999(Revised 2001 Oct)
EEL 3801C EEL 3801 Part I Computing Basics. EEL 3801C Data Representation Digital computers are binary in nature. They operate only on 0’s and 1’s. Everything.
THE BINARY SYSTEM.
Data Representation, Number Systems and Base Conversions
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
Computer Math CPS120 Introduction to Computer Science Lecture 4.
Introduction to Microprocessors Chapter 2. Decimal or Base 10 Numbers  Have ten different digits (0-9)  It is a weighted number system. Each position.
SAK Chapter 21 Chapter 2 : Number System 2.1 Decimal, Binary, Octal and Hexadecimal Numbers 2.2 Relation between binary number system with other.
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Assoc. Prof. Dr. Ahmet Turan ÖZCERİT.  The necessity and advantages of coding  The variety of coding systems You will learn: 2.
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
Chapter 1: Binary Systems
Introduction to Digital Electronics Lecture 2: Number Systems.
ECE DIGITAL LOGIC LECTURE 3: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/19/2016.
ECE DIGITAL LOGIC LECTURE 4: BINARY CODES Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/26/2016.
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
Nguyen Le CS147.  2.4 Signed Integer Representation  – Signed Magnitude  – Complement Systems  – Unsigned Versus Signed Numbers.
Computer Math CPS120 Introduction to Computer Science Lecture 7.
CHAPTER 3 BINARY NUMBER SYSTEM. Computers are electronic machines which operate using binary logic. These devices use two different values to represent.
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.
Some basic concepts underlying computer archi­tecture
Chapter 1 Digital Systems and Binary Numbers
3.1 Denary, Binary and Hexadecimal Number Systems
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
CHAPTER 1 : INTRODUCTION
Introduction The term digital is derived from the way computers perform operation, by counting digits. Application of digital technology: television, communication.
Number Systems.
Chapter 1 Digital Systems and Binary Numbers
University of Gujrat Department of Computer Science
2 Number Systems and Codes Edited by Jerry Bernardini.
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
Chapter 2 Bits, Data Types & Operations Integer Representation
COMS 161 Introduction to Computing
Binary to Decimal Conversion
ECE 331 – Digital System Design
Presentation transcript:

Data Storage and manipulation

Data Storage Computers store and manipulate data in the form of electronic pulses (high and Low voltages). This digitised data is represented numerically using the binary number system (base 2) which uses only 1 and 0.

Converting decimal numbers to binary numbers Divide the number by 2 noting the answer and the remainder. Repeat the division of the answer by 2, again noting the answer and the remainder. When the final answer is zero, write the remainders from the final remainder to the first. This is the binary value.

Convert 19 from base 10 to binary

Converting binary numbers to decimal numbers

Starting from the right, each number is twice the one before it. Write the digits of the binary number in the columns of the table, starting from the right. Add up the decimal values of the columns where there is a 1 to get the decimal equivalent of your number.

Example

You can add binary numbers using four simple rules: 0+0=0 0+1=1 1+0= = 10(10 is the binary value of 2: you say ‘one zero’, not ‘ten’.) (and 1 + I + 1 = ii: you say ‘one one’, not ‘eleven’.) Example 3 Add

Binary Addition You can add binary numbers using four simple rules:

Representing positive and negative numbers There are three systems used to represent positive and negative numbers: Binary Coded Decimal Sign and magnitude Two’s complement.

Binary Coded Decimal (BCD) A four-bit code is also assigned for the + and — signs: + = 1110 — = 1111

Binary Coded Decimal (BCD) A four-bit code is also assigned for the + and — signs: + = 1110 — = 1111

Example 4 Convert —910 to BCD. Write down the four-bit binary code for the minus sign and each decimal digit. The bits are written all together.

Sign and Magnitude System The sign and magnitude system works as follows. 1Write a binary 1 for a minus sign or a 0 for a plus sign. This will be the leftmost bit in the answer 2Ignore the sign of the given number and convert to binary as shown in Example 1. 3Write the binary value, adding any zeros on the left if a specific number of bits is required. Remember to include the sign bit on the left as one of the required bits in the answer.

Example 5 Convert -14 to 8-bit sign and magnitude. The number is negative, so the sign bit is converted into binary = 1110 Therefore the answer for -14 in 8 bits is in 8-bit sign magnitude Sign Value=14

Two’s complement system Complements are commonly used to represent negative numbers. You can think of a number as the ‘mirror image’ of its complement written to the same base. In the binary system, the complement of 1 is 0, and vice versa.

Two’s complement Two’s complement is very important when you want to subtract one binary number from another. The logic circuits of the ALU can readily add two numbers, but not subtract them. Adding one binary number to the two’s complement of another binary number is equivalent to subtracting the second one from the first one.

Two’s complement. Therefore two’s complement not only allows the computer to store both positive and negative integers but also allows it to do both addition and subtraction operations. In this system it is most important to note the number of bits required for the answer. The two’s complement system works like this.

1Ignore the sign of the given value and convert the number to binary. 2Add any required zeros on the left of the binary value so that it has the required number of bits. 3If the number is positive then this is the final answer. If it is negative than continue to the next step. 4Invert the bits of the binary number by changing every ito 0 and every 0 to 1. 5Using binary addition, add 1 to this number. This gives the final answer.

Example 6 Represent -14 in 8-bit two’s complement. First convert 14 to binary: 14 =1110 in binary which is = in 8 bits Inverting each bit gives= Finally add 1: = Therefore -14 is in 8-bit two’s complement.

Parity This is an error checking system which makes sure that when data is sent from one computer to another no errors have crept into the code. An extra ‘parity’ bit is added to the end of each binary code. If the system used is odd parity, the extra bit is chosen to ensure there is an odd number of 1-bits in the pattern.

Parity Even parity adds a bit to each binary code to ensure there is an even number of 1-bits in the pattern. If one of the digits in the code is wrong when the information is received, then the parity bit will be wrong.

Exainple for even parity the parity bit shown is 1 (six 1s) for odd parity; the parity bit shown is 0 (five 1s)

Parity

Representing alphanumeric characters When data in the form of numbers, letters and symbols is input to a computer, for example using a keyboard, it must be represented inside the computer by binary codes. A different code is used for each symbol.

Code System There are two coding systems which provide each character with its own unique binary character code for use on the computer: ASCII — American Standard Code for Information Interchange EBCDIC — Extended Binary Code Decimal Interchange Code

ASCII Code ASCII is used on most microcomputers and represents each symbol as a 7- or 8- bit binary code. These codes are sequential for the alphabet and for numbers. That is, if’a’ is represented as then ‘b’ is represented as , ‘c’ is represented as and so on. Adding 1 to each pattern gives the code for the next letter. EBCDIC is a similar coding system used mainly on IBM mainframe systems.

Example 8 If the ASCII code for ‘d’ is , find the ASCII code for ‘i’. 1Convert the binary code to decimal. ( = = 68) 2Determine how far the required letter is from the letter given. (‘i’ is 5 letters after ‘d’) 3Add this number to the decimal value. ( = 73) 4Convert this final decimal value to binary. 73 = in binary Therefore the ASCII code for ‘i’ is

Computer Data Computers represent their data as digitised electronic pulses called discrete data. That is, it can only take one of a finite set of values such as 0 or 1. This is different from continuous data, also called analog data, which can take all in- between values: examples are measurements such as height or weight. So the waist sizes of students in a class form continuous data, whereas the number of students in the class represents discrete data.

1Convert the following to binary: a 63 b 25 c 54 d 81 e 12 2Convert the following to decimal: a b c Add the following number: a 0101 and 001 b 0111 and 0010 c 0100 and Name the three methods by which positive and negative numbers may be represented.

5Convert the following numbers to BCD: a-456 b 512 c 987 d 600 6Convert the following to 8-bit sign and magnitude:a-21b-55 a81 a32 7Represent in 8-bit two’s complement the following: A-21b-55 a81 a32 8If the ASCII code for ‘d’ is , find the ASCII code for ‘a’