Comp 1001 Introduction to Information Technology & Computer Architecture Wednesday 12-1Dr. Joe Carthy http://www.cs.ucd.ie/staff/jcarthy/home/

Slides:



Advertisements
Similar presentations
Comp 1001 Introduction to Information Technology & Computer Architecture Wednesday 12-1Dr. Joe Carthy
Advertisements

ICS312 Set 2 Representation of Numbers and Characters.
Representing Numbers: Integers
Data Representation Computer Organization &
Data Representation COE 205
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Introduction to Programming with Java, for Beginners
Binary Expression Numbers & Text CS 105 Binary Representation At the fundamental hardware level, a modern computer can only distinguish between two values,
Binary and Decimal Numbers
IT-101 Section 001 Lecture #4 Introduction to Information Technology.
Computer Systems 1 Fundamentals of Computing
Binary and Hexadecimal Numbers
Aug CMSC 104, LECT-021 Machine Architecture and Number Systems Some material in this presentation is borrowed form Adrian Ilie From The UNIVERSITY.
Comp 1001: IT & Architecture - Joe Carthy 1 Information Representation: Summary All Information is stored and transmitted in digital form in a computer.
Numbering systems.
CSC 101 Introduction to Computing Lecture 9 Dr. Iftikhar Azim Niaz 1.
Computers Organization & Assembly Language
1 Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number System Converting.
Chapter Two Hardware Basics: Inside the Box. ©1999 Addison Wesley Longman2.2 Chapter Outline What Computers Do A Bit About Bits The Computer’s Core: CPU.
Copyright © 2003 by Prentice Hall Module 5 Central Processing Unit 1. Binary representation of data 2. The components of the CPU 3. CPU and Instruction.
Comp Sci 251 Intro 1 Computer organization and assembly language Wing Huen.
Computer Programming I. Today’s Lecture  Components of a computer  Program  Programming language  Binary representation.
Hardware Data Storage.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
ICS312 Set 1 Representation of Numbers and Characters.
Machine Architecture CMSC 104, Section 4 Richard Chang 1.
What is a computer? A computer is a device that:
CPU Internal memory I/O interface circuit System bus
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
CISC1100: Binary Numbers Fall 2014, Dr. Zhang 1. Numeral System 2  A way for expressing numbers, using symbols in a consistent manner.  " 11 " can be.
Introduction to Programming Instructor: Yong Tang Brookhaven National Laboratory Working on accelerator control (BNL Phone #)
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.
Data Representation Conversion 24/04/2017.
Do it now activity Can you work out what the missing symbols are and work out the order they should be in if the table shows smallest to largest KB kilobyte.
Data Representation, Number Systems and Base Conversions
Computer Math CPS120 Introduction to Computer Science Lecture 4.
Data Representation (in computer system). Data Representation How do computers represent data? b The computers are digital Recognize.
Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
COMPUTER SYSTEM A computer system is define as combination of components designed to process data and store files. A computer system consists of four.
Computer Math CPS120 Introduction to Computer Science Lecture 7.
09/06/ Data Representation ASCII, Binary Denary Conversion, Integer & Boolean data types.
 Computers are 2-state devices › Pulse – No pulse › On – Off  Represented by › 1 – 0  BINARY.
Binary a. express numbers in binary, binary-coded decimal (BCD), octal and hexadecimal;
Data Representation COE 308 Computer Architecture
Computer Architecture and Number Systems
Computer basics.
Bits, Data Types, and Operations
Data Representation.
Data Representation ICS 233
Lec 3: Data Representation
Data Representation.
Assembly Language (CSW 353)
3.1 Denary, Binary and Hexadecimal Number Systems
Storage Hardware This icon indicates the slide contains activities created in Flash. These activities are not editable. For more detailed instructions,
CHAPTER 1 : INTRODUCTION
Memory Parts of a computer
Information Support and Services
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.
Computer Hardware Introduction.
Machine Architecture and Number Systems
How do computers work? Storage.
Information Representation
Chapter Four Data Representation in Computers By Bezawit E.
Data Representation ICS 233
UNIT – 3 & 4. Data Representation and Internal
Networks & I/O Devices.
Data Representation COE 308 Computer Architecture
Presentation transcript:

Comp 1001 Introduction to Information Technology & Computer Architecture Wednesday 12-1Dr. Joe Carthy http://www.cs.ucd.ie/staff/jcarthy/home/

Comp 1001: IT & Architecture - Joe Carthy Course Outline Introduction to Information Technology Hardware and Software I/O and Storage devices CPU RAM Information Representation: ASCII codes Binary and Hexadecimal Numbers Computer Networks Operating Systems Comp 1001: IT & Architecture - Joe Carthy

Course Outline Continued Computer Architecture and Assembly Language CPU structure Introduction to Assembly Language (8086) Instruction Set Basic Assembly Language Programs Fetch-Execute Cycle Pipelining Memory: RAM access and Cache Memory Computer performance evaluation Practicals Comp 1001: IT & Architecture - Joe Carthy

Course Outcomes At the end of this course Students should have a grasp of functional components of a computer system information representation assembly language instructions instruction execution CPU structure and functioning knowledge of performance evaluation Comp 1001: IT & Architecture - Joe Carthy

Comp 1001: IT & Architecture - Joe Carthy Recommended Texts Recommended Texts: Computers (Tools for the Information Age), Brief Edition, H.L. Capron, Prentice Hall Introduction to Assembly Language Programming and Computer Architecture, J. Carthy, ITP Web Notes http://www.cs.ucd.ie/staff/jcarthy/home/ Comp 1001: IT & Architecture - Joe Carthy

Simple Model of a Computer System Hardware Physical components that make up a computer system System: interconnected set of devices that function as a unit Software Computer programs that allow you use a computer Comp 1001: IT & Architecture - Joe Carthy

Simple Model of a Computer System Version 1 Comp 1001: IT & Architecture - Joe Carthy

Simple Model of a Computer System Version 2 Comp 1001: IT & Architecture - Joe Carthy

Comp 1001: IT & Architecture - Joe Carthy System Devices Classified as: Storage devices: store information RAM Disk CD/DVD Input/Output (I/O) devices: carry info to/from Computer Monitor (screen) Printer Mouse/Keyboard Speakers Comp 1001: IT & Architecture - Joe Carthy

Comp 1001: IT & Architecture - Joe Carthy Review Questions What is a computer system ? Explain the difference between hardware and software What are the two major device classes ? What is a peripheral device ? What is the function of the processor ? What is the function of memory (RAM) ? What are the major devices ? What is a bus ? Comp 1001: IT & Architecture - Joe Carthy

Information Representation How is “information” represented in a computer system ? What are the different types of information Text Numbers Images Video Photographic Audio Comp 1001: IT & Architecture - Joe Carthy

Everything is in Binary ! (1’s and 0’s) Computers are digital devices - they can only manipulate information in digital (binary) form. Easy to represent 1 and 0 in electronic, magnetic and optical devices Only need two states High/low On/off Up/down etc All information in a computer system is Processed in binary form Stored in binary form Transmitted in binary form Comp 1001: IT & Architecture - Joe Carthy

How is information converted to Binary form I/O and Storage Devices are digital I/O devices convert information to/from binary A keyboard converts the character “A” you type into a binary code to represent “A” E.g. “A” is represented by the binary code 01000001 Monitor converts 01000001 to the “A” that you read Comp 1001: IT & Architecture - Joe Carthy

Comp 1001: IT & Architecture - Joe Carthy Bits and Bytes One binary digit i.e. 1 or 0 is called a bit A group of 8 bits is one byte Byte is the unit of storage measurement Number of Bytes Unit 1024 bytes (210 bytes) 1 Kilobyte (Kb) 1024 Kb (220 bytes) 1 Megabyte (Mb) 1024 Mb (230 bytes) 1 Gigabyte (Gb) 1024 Gb (240 bytes) 1 Terabyte (Tb) 1024 Tb (250 bytes) 1 Petabyte (Pb) Comp 1001: IT & Architecture - Joe Carthy

Representing Text- ASCII Code Textual information is made up of individual characters e.g. Letters: Lowercase: a,b,c,..z Uppercase: A,B,C..Z Digits: 0,1,2,..9 Punctuation characters: ., :, ; ,, “, ’ Other symbols: -, +, &, %, #, /,\,£, etc.). Comp 1001: IT & Architecture - Joe Carthy

Representing Text- ASCII Code Each character is represented by a unique binary code. ASCII is one international standard that specifies the binary code for each character. American Standard Code for Information Interchange It is a 7-bit code - every character is represented by 7 bits There are other standards such as EBCDIC but these are not widely used. ASCII is being superceded by Unicode of which ASCII is a subset. Unicode is a 16-bit code. Comp 1001: IT & Architecture - Joe Carthy

Comp 1001: IT & Architecture - Joe Carthy Sample ASCII Codes Char ASCII Decimal NUL 000 0000 00 BEL 000 0111 07 LF 000 1010 10 CR 000 1011 13 011 0000 48 SP 010 0000 20 1 011 0001 49 ! 010 0001 21 2 011 0010 50 “ 010 0010 22 9 011 1001 57 A 100 0001 65 a 110 0001 97 B 100 0010 66 b 110 0010 98 C 100 0011 67 c 110 0011 99 Y 101 1001 89 y 111 1001 121 Z 101 1010 90 z 111 1010 122 Comp 1001: IT & Architecture - Joe Carthy

Comments on ASCII Codes Codes for A to Z and a to z form collating sequences A is 65, B is 66, C is 67 and so on A is 97, b is 98, c is 99 and so on Lowercase code is 32 greater than Uppercase equivalent Note that digit ‘0’ is not the same as number 0 ASCII is used for characters Not used to represent numbers (See later) Codes 0 to 30 are typically for Control Characters Bel - causes speaker to beep ! Carriage Return (CR); LineFeed (LF) Others used to control communication between devices SYN, ACK, NAK, DLE etc Comp 1001: IT & Architecture - Joe Carthy

Comp 1001: IT & Architecture - Joe Carthy Review All information stored/transmitted in binary Devices convert to/from binary to other forms that humans understand Bits and Bytes Kb, Mb, Gb, Tb and Pb are storage metrics ASCII code is a 7-bit code to represent text characters Text “numbers” not the same as “maths” numbers Do not add phone numbers or get average of PPS numbers ! Comp 1001: IT & Architecture - Joe Carthy

Comp 1001: IT & Architecture - Joe Carthy Review Questions How is information transmitted inside a computer Why do we use binary in computers What is an ASCII code used for How big is an ASCII code What is the ASCII code for: A, ‘0’, ‘a’ What is a collating sequence What is a control character - give an example What is Unicode and why is it used What is a bit ? A byte ? How many bytes in: Kb, Mb, Gb, Tb, Pb Comp 1001: IT & Architecture - Joe Carthy

Representing Numbers: Integers Humans use Decimal Number System Computers use Binary Number System Important to understand Decimal system before looking at binary system Decimal Numbers - Base 10 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Positional number system: the position of a digit in a number determines its value Take the number 1649 The 1 is worth 1000 The 9 is worth 9 units Formally, the digits in a decimal number are weighted by increasing powers of 10 i.e. they use the base 10. We can write 1649 in the following form: 1*103 + 6*102 + 4*101 + 9*100 Comp 1001: IT & Architecture - Joe Carthy

Representing Numbers: Integers weighting: 103 102 101 100 Digits 1 6 4 9 1649 = 1*103 + 6*102 + 4*101 + 9*100 Least Significant Digit: rightmost one - 9 above Lowest power of 10 weighting Digits on the right hand side are called the low-order digits (lower powers of 10). Most Significant Digit: leftmost one - 1 above Highest power of 10 weighting The digits on the left hand side are called the high-order digits (higher powers of 10) Comp 1001: IT & Architecture - Joe Carthy

Representing Numbers: Decimal Numbers Largest n-digit number ? Made up of n consecutive 9’s (= 10n -1 ) Largest 4-digit number if 9999 9999 is 104 -1 Distinguishing Decimal from other number systems such as Binary, Hexadecimal (base 16) and Octal (base 8) How do we know whether the number 111 is decimal or binary One convention is to use subscripts Decimal: 11110 Binary:1112 Hex: 11116 Octal: 1118 Difficult to write use keyboard Another convention is to append a letter (D, B, H, O) Decimal: 111D Binary:111B Hex: 111H Octal: 111O Comp 1001: IT & Architecture - Joe Carthy

Representing Numbers: Binary Numbers Binary numbers are Base 2 numbers Only 2 digits: 0 and 1 Formally, the digits in a binary number are weighted by increasing powers of 2 They operate as decimal numbers do in all other respects Consider the binary number 0101 1100 Weight 27 26 25 24 23 22 21 20 bits 0 1 0 1 1 1 0 0 01011100 = 0*27 + 1*26 + 0*25 + 1*24 + 1*23 + 1*22 + 0*21 + 0*20 = 0 + 6410 + 0 + 1610 + 810 + 410 + 0 + 0 = 9210 Comp 1001: IT & Architecture - Joe Carthy

Representing Numbers: Binary Numbers Leftmost bit is the most significant bit (MSB). The leftmost bits in a binary number are referred to as the high-order bits. Rightmost bit is the least significant bit (LSB). The rightmost bits in a binary number are referred to as the low-order bits. Largest n-bit binary number ? Made up of n consecutive 1’s (= 2n -1) e.g. largest 4-bit number: 1111 = 24 -1 = 15 Comp 1001: IT & Architecture - Joe Carthy

Representing Numbers: Binary Numbers Exercises Convert the following binary numbers to decimal: (i) 1000 1000 (ii) 1000 1001 (iii) 1000 0111 (iv) 0100 0001 (v) 0111 1111 (vi) 0110 0001 Joe Carthy Formatting Convention In these notes we insert a space after every 4 bits to make the numbers easier to read Comp 1001: IT & Architecture - Joe Carthy

Representing Numbers: Converting Decimal to Binary To convert from one number base to another: you repeatedly divide the number to be converted by the new base the remainder of the division at each stage becomes a digit in the new base until the result of the division is 0. Example: To convert decimal 35 to binary we do the following: Remainder 35 / 2 1 17 / 2 1 8 / 2 0 4 / 2 0 2 / 2 0 1 / 2 1 The result is read upwards giving 3510 = 1000112. Comp 1001: IT & Architecture - Joe Carthy

Representing Numbers: Converting Decimal to Binary Exercise: Convert the following decimal numbers to binary (1) 64 (2) 65 (3) 32 (4) 16 (5) 48 Shortcuts To convert any decimal number which is a power of 2, to binary, simply write 1 followed by the number of zeros given by the power of 2. For example, 32 is 25, so we write it as 1 followed by 5 zeros, i.e. 10000; 128 is 27 so we write it as 1 followed by 7 zeros, i.e. 100 0000. Remember that the largest binary number that can be stored in a given number of bits is made up of n 1’s. An easy way to convert this to decimal, is to note that this is 2n - 1. For example, if we are using 4-bit numbers, the largest value we can represent is 1111 which is 24-1, i.e. 15 Comp 1001: IT & Architecture - Joe Carthy

Representing Numbers: Converting Decimal to Binary Binary Numbers that you should remember because they occur so frequently Binary Decimal 111 7 1111 15 0111 1111 127 1111 1111 255 Comp 1001: IT & Architecture - Joe Carthy

Comp 1001: IT & Architecture - Joe Carthy Review Decimal Number System - Base 10 Significant Digits Binary Number System - Base 2 Notation (B,D,H,O) Binary to Decimal Decimal to Binary Shortcuts and Common Binary Numbers Review Questions What is a positional number system ? What is the MSB and the LSB. Give an example of each one. Show how the weights of the bits in an 8-bit binary number 16-bit binary numbe What is the weight of the MSB in (a) 8-bit number (b) 16-bit number (c) 32-bit number Convert 48D, 65D, 31D, 15D to binary Convert 1111 0111B, 1010 1010B and 1110 0111B to decimal Comp 1001: IT & Architecture - Joe Carthy