Data Representation Prepared by Dr P Marais (Modified by D Burford)

Slides:



Advertisements
Similar presentations
ICS312 Set 2 Representation of Numbers and Characters.
Advertisements

COMP 2130 Intro Computer Systems Thompson Rivers University
CMPUT Computer Organization and Architecture I
IT Systems What Number? EN230-1 Justin Champion C208 –
Binary & Decimal numbers = 3* * *10 + 5*1 = 3* * * *10 0 Decimal system: Ten digits: 0,1,2,3,…,9 Example:
Binary Representation
Representing Information as Bit Patterns Lecture 4 CSCI 1405, CSCI 1301 Introduction to Computer Science Fall 2009.
Introduction to Computing CPSC 203 January 24, 2006 Heejin Lim Chapter 1 Chapter 2 (part of)
Number Representation (1) Fall 2005 Lecture 12: Number Representation Integers and Computer Arithmetic.
Implementation of a Stored Program Computer
+ CS 325: CS Hardware and Software Organization and Architecture Integers and Arithmetic Part 4.
Data Representation (in computer system) Computer Fundamental CIM2460 Bavy LI.
Number Systems and Codes In PLC
COMPUTER FUNDAMENTALS David Samuel Bhatti
CHARACTERS Data Representation. Using binary to represent characters Computers can only process binary numbers (1’s and 0’s) so a system was developed.
Hexadecimal and ASCII Lesson Objective: Understand the purpose of ASCII and how to use it. Lesson Outcome: Convert between Hexadecimal and ASCII Convert.
Computer System Basics 1 Number Systems & Text Representation Computer Forensics BACS 371.
Number Systems and Logic UCT Dept of Computer Science CSC
Data Representation S2. This unit covers how the computer represents- Numbers Text Graphics Control.
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
Binary Code.
Number Systems Spring Semester 2013Programming and Data Structure1.
Binary, Decimal and Hexadecimal Numbers Svetlin Nakov Telerik Corporation
ICS312 Set 1 Representation of Numbers and Characters.
Implementation of a Stored Program Computer ITCS 3181 Logic and Computer Systems 2014 B. Wilkinson Slides2.ppt Modification date: Oct 16,
1 3 Computing System Fundamentals 3.5 Data Representation.
Chapter 19 Number Systems. Irvine, Kip R. Assembly Language for Intel-Based Computers, Translating Languages English: Display the sum of A times.
Number Systems and Logic Prepared by Dr P Marais (Modified by D Burford)
Number Systems and Logic UCT Dept of Computer Science CS115 ~ 2003.
The character data type char. Character type char is used to represent alpha-numerical information (characters) inside the computer uses 2 bytes of memory.
Info stored in computer (memory) Numbers All in binaray – can be converted to octal, hex Characters ASCII – 1-byte/char Unicode – 2-byte/char Unicode-table.com/en.
CHAPTER 3 Arithmetic For Computers 1/31/ Topics for discussion 1/31/ Number system: { radix/base, a set of distinct digits, operations} Radix.
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
Binary 101 Gads Hill School. Aim To strengthen understanding of how computers use the binary number system to store information.
CS 125 Lecture 3 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
Memory, Bits, & Bytes. Memory Part of the computer where programs and data are stored. Read and written (changed). Bit – Binary digit – Basic unit of.
Number Systems and Representations Binary Representation Binary Representation Signed numbers Signed numbers Very small and very big numbers Very small.
THE CODING SYSTEM FOR REPRESENTING DATA IN COMPUTER.
Computers: Information Technology in Perspective By Long and Long Copyright 2002 Prentice Hall, Inc. Encoding J. Holvikivi 2012.
1.4 Representation of data in computer systems Character.
Lecture Coding Schemes. Representing Data English language uses 26 symbols to represent an idea Different sets of bit patterns have been designed to represent.
Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text
Binary Representation in Text
Binary Representation in Text
Binary & Decimal numbers
Number Systems and Codes
Lesson Objectives Aims You should be able to:
Big-Endians Little-Endians and Bi-Endians
Unit 18: Computational Thinking
Data Representation Binary Numbers Binary Addition
CSCI 198: Lecture 4: Data Representation
Exercise 1: Binary number and hex number
Data Transfer ASCII FILES.
CSCI 161: Lecture 4: Data Representation
EPSII 59:006 Spring 2004.
Slide design: Dr. Mark L. Hornick
Representing Information as bit patterns
Data Encoding Characters.
Data Representation ASCII.
Data Representation Question: Characters
Computers & Programming Languages
Numbering System TODAY AND TOMORROW 11th Edition
Binary Lesson 3 Hexadecimal
C1 Number systems.
Storing Negative Integers
Learning Intention I will learn how computers store text.
Computer Architecture CST 250
Chapter 3 - Binary Numbering System
Lecture 36 – Unit 6 – Under the Hood Binary Encoding – Part 2
ASCII and Unicode.
Presentation transcript:

Data Representation Prepared by Dr P Marais (Modified by D Burford)

Bits, Bytes, Words Bit is a single binary digit Byte is 8 bits Word can be 16-bits (2 bytes) or 32-bits (4 bytes).

Basic data types in Java byte:8-bits, 1 byte (surprisingly!) short:16-bits, 2 bytes int:32-bits, 4 bytes long:64-bits, 8 bytes float:32-bits, 4 bytes double:64-bits, 8 bytes

Bits, Bytes, Words Bytes are often written using hexadecimal One byte (8-bits) can be made up of 2 hexadecimal digits (4-bits each). E.g. –byte b = 15; // 0F in hex –byte b = 255; // FF in hex –int i = 1,000,000; // 3B 9A CA 00 in hex

Byte Ordering “Endianess”: ordering of bytes in computer memory 012……nn+1n+2… Bytes in memory … low address high address n+3

Byte Ordering Big Endian: –Bytes ordered from Most Significant Byte (MSB) to Least Significant Byte (LSB) Little Endian: –Bytes ordered from LSB to MSB

Byte Ordering: Example E.g. How is F (32-bit number) represented in memory? 012……nn+1n+2… … low address high address n+3

Byte Ordering: Example E.g. How is F (32-bit number) represented in memory? high address 012……nn+1n+2… … F low address n+3 BIG ENDIAN MSBLSB

Byte Ordering: Example E.g. How is F (32-bit number) represented in memory? high address 012……nn+1n+2… … 0F low address n+3 LITTLE ENDIAN LSBMSB

Byte Ordering Problems with multi-byte data: floats, ints etc. Sun is Big Endian, Intel is Little Endian Bit ordering issues as well: endian on MSb/LSb

Character Representations Characters represented using “character set” –ASCII (8-bit) –Unicode (16-bit)

Character Representations: ASCII ASCII - American Standard Code for Information Interchange 8-bits means 256 characters (0-255) ASCII codes for roman alphabet, numbers, keyboard symbols and basic network control

Character Representations: Unicode Unicode: 16-bits, quite new: subsumes ASCII, extensible, supported by Java 16-bits means characters ( ) Handles many languages, not just roman alphabet, symbols