Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Basic Data Types Characters vs. Numbers Adding in Binary: There are only.

Slides:



Advertisements
Similar presentations
Information Representation
Advertisements

CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 1.
Text Representation within Computers CS208. The Binary Digit (Bit) One bit can encode a value set that contains two elements e.g. {black, white}, {up,
Binary Expression Numbers & Text CS 105 Binary Representation At the fundamental hardware level, a modern computer can only distinguish between two values,
Chapter 1.5 The Binary System CSCI 3. Basic Concepts Behind the Binary System In the decimal system, things are organized into columns – H | T | O – 1.
1 Lecture-2 CS-120 Fall 2000 Revision of Lecture-1 Introducing Computer Architecture The FOUR Main Elements Fetch-Execute Cycle A Look Under the Hood.
Data Representation – Chapter 3 Sections 3-2, 3-3, 3-4.
Binary Numbers.
Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Basic Data Types Note that the methods we used to convert from decimal.
CODING SYSTEMS CODING SYSTEMS CODING SYSTEMS. CHARACTERS CHARACTERS digits: 0 – 9 (numeric characters) letters: alphabetic characters punctuation marks:
9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU1 Codes.
Hexadecimal and ASCII Lesson Objective: Understand the purpose of ASCII and how to use it. Lesson Outcome: Convert between Hexadecimal and ASCII Convert.
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
1 Survey of Computer Science CSCI 110, Spring 2011 Lecture 16 Digital Circuits, binary Numbers.
Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Strings Do we need to convert integers (or longs, or floats) to strings.
Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Bits and Bytes There was one other problem with bytes: Compatibility Compatibility.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Signed Numbers, Powers, & Roots
Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Basic Data Types Chapter 2 Basic Data Types.
Data Representation S2. This unit covers how the computer represents- Numbers Text Graphics Control.
Numbering Systems. CSCE 1062 Outline What is a Numbering System Review of decimal numbering system Binary representation range Hexadecimal numbering system.
Foundations of Computer Science Computing …it is all about Data Representation, Storage, Processing, and Communication of Data 10/4/20151CS 112 – Foundations.
Chapter 3 Section 1 Number Representation Modern cryptographic methods, unlike the classical methods we just learned, are computer based. Representation.
Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Bits and Bytes How Many bits (or ‘doughnuts’) do we really need? Good question!
Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Basic Data Types Floating-Point (real) numbers Consider the Number:4,
Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Basic Data Types Remember when we first talked about the different combinations.
©Contrinex JDC PPT_XF_BinHexDecASCII Encoding information J.-D. Chatelain.
Lecture 11: Chapter 2 Today’s topic –Numerical representations Reminders –Homework 3 posted, due 9/29/2014 –Homework 4 posted, due 10/6/2014 –Midterm 1.
Chapter 2 Number Systems: Decimal, Binary, and Hex.
Computer Science Binary. Binary Code Remember the power supply that is inside your computer and how it sends electricity to all of the components? That.
THE BINARY SYSTEM.
Data Representation, Number Systems and Base Conversions
Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft RAM Allocation Chapter 3.
Chapter 7 Section 7.2 Addition & Subtraction in Different Bases.
Springfield Technical Community College Center for Business and Technology.
1 Ethics of Computing MONT 113G, Spring 2012 Session 1 Digital Circuits, binary Numbers Course webpage:
Agenda Character representation Numerical Conversions ASCII EBCDIC
Number Systems by Dr. Amin Danial Asham. References  Programmable Controllers- Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
Compare and Order Decimals Less Than One 6N3.2. Get ready! Look at the table Which city has the longest subway system? Explain.
Topic 14.1 Extended Hexadecimal  Decimal is base 10 and uses 10 digits (0,1,2,3,4,5,6,7,8,9).  Binary is base 2 and uses 2 digits (0,1).  Computers.
Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Strings Chapter 5.
©2010 Cengage Learning SLIDES FOR CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION Click the mouse to move to the next page. Use the ESC key to exit.
TOPICS:  Introduction  Place Value  Binary  Decimal conversion  Decimal  Binary conversion  Related terms  Quiz.
Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Bits & Bytes OR OffOn Bit = Binary Digit (or Binary Digit) = {0, 1} Bits.
1.4 Representation of data in computer systems Character.
COMPUTER ORGANIZATION 4 TH LECTURE. ASCII Code  ASCII ( American Standard Code for Information Interchange).  Input and output devices that communicate.
WHAT IS BINARY? Binary is a number system that only uses two digits: 1 and 0. Any information that processed by a computer it is put into sequence of.
Topic: Binary Encoding – Part 1
Consider this number: , Ones (7 ones) Tens (no tens)
Binary Positional Notation
BINARY CODE.
Numerical Representation
Data Transfer ASCII FILES.
What is Binary? Binary is a two-digit (Base-2) numerical system, which computers use to process and store data. The reason computers use the binary system.
Representing characters
Other Kinds of Arrays Chapter 11
RFID - EN Encoding information Encoding information J.-D. Chatelain.
Data Encoding Characters.
Coding Schemes and Number Systems
Data Representation – Chapter 3
Binary Numbers? Foley SED 514 Section /2/2019.
Chapter 1 Number System RGGP, Narwana.
Plan Attendance Files Posted on Campus Cruiser Homework Reminder
How Computers Store Data
Numerical Representation
Binary Numbers The Binary number system is derived from Base 2. In base 2 there are only 2 numerical options 0 and 1. The computer sees these as Off.
WJEC GCSE Computer Science
Chapter 3 - Binary Numbering System
Numerical Representation
Section 6 Primitive Data Types
Presentation transcript:

Page 1 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Basic Data Types Characters vs. Numbers Adding in Binary: There are only four (4) possible combinations: Remember: Since binary contains the only the digits 0 & 1, the number 2 must be represented using 2 digits (10) Similarly, in Decimal, there is no symbol for ten, so we must use two symbols: 1 and 0 (10).

Page 2 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Basic Data Types Some additional Examples of adding in Binary:

Page 3 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Basic Data Types From the ASCII Tables, we know: is the sequence of bits needed to represent ‘3’ is the sequence of bits needed to represent ‘4’ Therefore: Must be the sequence of bits needed to represent ‘7’ According to the ASCII Tables is the sequence of bits needed to represent the character ‘g’. What Gives??

Page 4 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Basic Data Types ASCII is a coding to scheme used to represent ONLY CHARACTERS AND/OR SYMBOLS. The character ‘3’ is no more a number than it is in the string “TJF-3H9” (License Plate Number??). Trying to add the characters ‘3’ and ‘4’ makes no more sense than trying to add the strings : How Now Brown Cow? + To be or not to be. Yielding: Good Golly, Miss Molly

Page 5 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Basic Data Types Does that mean the computer really doesn’t work with numbers, only symbols?? NO - The computer works ONLY with numeric values: The character ‘3’ is actually the numeric value: 51 The character ‘4’ is actually the numeric value: 52 The character ‘g’ is actually the numeric value: 103 Check your ASCII Tables

Page 6 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft Basic Data Types Why are there differences?? Why isn’t the character ‘3’ stored the same way as the number 3??? In order to draw the distinction between Numbers and Characters. How would the numbers 3 and 4 be stored? Basically, in the same manner in which we stored them when we first started talking about bits.

Page 7 Data Structures in C for Non-Computer Science Majors Kirs and Pflughoeft  Repeat Slides for this SectionRepeat Slides for this Section  Go To Next Set of Slides For this ChapterGo To Next Set of Slides For this Chapter  Go To Slide Index For Chapter 2Go To Slide Index For Chapter 2  Go To Slide Index For Chapter 3Go To Slide Index For Chapter 3  Go To Slide Index For TextbookGo To Slide Index For Textbook  Go To Home PageGo To Home Page This Concludes The Slides for this Section Choose an Option: