COSC 243 (Computer Architecture)

Similar documents
Final Labs and Tutors

Homework 1 graded and returned in class today. Solutions posted online. Request regrades by next class period. Question 10 treated as extra credit

Representing Characters, Strings and Text

Multimedia Data. Multimedia Data. Text Vector Graphics 3-D Vector Graphics. Raster Graphics Digital Image Voxel. Audio Digital Video

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.

Chapter 4: Computer Codes. In this chapter you will learn about:

UTF and Turkish. İstinye University. Representing Text

Princeton University. Computer Science 217: Introduction to Programming Systems. Data Types in C

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation

Data Representation. DRAM uses a single capacitor to store and a transistor to select. SRAM typically uses 6 transistors.

DRAM uses a single capacitor to store and a transistor to select. SRAM typically uses 6 transistors.

Representing Characters and Text

LOGIC DESIGN. Dr. Mahmoud Abo_elfetouh

The Unicode Standard Version 10.0 Core Specification

Information Science 1

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

MACHINE LEVEL REPRESENTATION OF DATA

Thus needs to be a consistent method of representing negative numbers in binary computer arithmetic operations.

Intermediate Programming & Design (C++) Notation

CS 121 Digital Logic Design. Chapter 1. Teacher Assistant. Hadeel Al-Ateeq

Announcement. (CSC-3501) Lecture 3 (22 Jan 2008) Today, 1 st homework will be uploaded at our class website. Seung-Jong Park (Jay)

CMPS 10 Introduction to Computer Science Lecture Notes

umber Systems bit nibble byte word binary decimal

The type of all data used in a C++ program must be specified

1.1 Information representation

Computer Architecture and System Software Lecture 02: Overview of Computer Systems & Start of Chapter 2

Title: Graphic representation of the Roadmap to the BMP of the UCS

The Building Blocks: Binary Numbers, Boolean Logic, and Gates. Purpose of Chapter. External Representation of Information.

Chapter 11 : Computer Science. Information Representation. Class XI ( As per CBSE Board) New Syllabus

Title: Graphic representation of the Roadmap to the BMP, Plane 0 of the UCS

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation

Introduction to Informatics

History of Computing. Ahmed Sallam 11/28/2014 1

Digital Systems COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

COMP 102: Computers and Computing

The type of all data used in a C (or C++) program must be specified

LING 388: Computers and Language. Lecture 5

Unicode and Standardized Notation. Anthony Aristar

Chapter 4: Data Representations

Chapter 2. Data Representation in Computer Systems

2011 Martin v. Löwis. Data-centric XML. Character Sets

Can R Speak Your Language?

2007 Martin v. Löwis. Data-centric XML. Character Sets

Inf2C - Computer Systems Lecture 2 Data Representation

CHAPTER 2 Data Representation in Computer Systems

Digital Fundamentals

QUIZ ch.1. 1 st generation 2 nd generation 3 rd generation 4 th generation 5 th generation Rock s Law Moore s Law

Hexadecimal Numbers. Journal: If you were to extend our numbering system to more digits, what digits would you use? Why those?

CHAPTER 2 Data Representation in Computer Systems

Fundamentals of Programming Session 2

The Unicode Standard Version 6.1 Core Specification

N.B. These pastpapers may rely on the knowledge gained from the previous chapters.

Fundamentals of Programming (C)

Lecture (03) Binary Codes Registers and Logic Gates

Fundamental concepts of Information Technology

Introduction to Numbering Systems

Binary Codes. Dr. Mudathir A. Fagiri

UNIT 2 NUMBER SYSTEM AND PROGRAMMING LANGUAGES

Electronic Data and Instructions

REPRESENTING INFORMATION:

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University

Computer Science Applications to Cultural Heritage. Introduction to computer systems

Chapter 7. Representing Information Digitally

Information technology Keyboard layouts for text and office systems. Part 9: Multi-lingual, multiscript keyboard layouts

5/17/2009. Digitizing Discrete Information. Ordering Symbols. Analog vs. Digital

Information Science 1

WELCOME TO. ENGR 303 Introduction to Logic Design. Hello my name is Dr. Chuck Brown

User. Application program. Interfaces. Operating system. Hardware

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Bits and Bytes and Numbers

Functional Programming in Haskell Prof. Madhavan Mukund and S. P. Suresh Chennai Mathematical Institute

Chapter 1. Hardware. Introduction to Computers and Programming. Chapter 1.2

Computer Organization and Assembly Language. Lab Session 4

Memory Addressing, Binary, and Hexadecimal Review

[301] Bits and Memory. Tyler Caraza-Harter

DATA PROCESSING Scheme of work for 2016 SS Three Extension Class

Microprocessors & Assembly Language Lab 1 (Introduction to 8086 Programming)

IT101. Characters: from ASCII to Unicode

Basic data types. Building blocks of computation

Number Systems. Dr. Tarek A. Tutunji Philadelphia University, Jordan

Week 1 Introduction to Computer and Algorithm (Part1) UniMAP Sem II 11/12 DKT121: Basic Computer Programming 1

Lecture C1 Data Representation. Computing and Art : Nature, Power, and Limits CC 3.12: Fall 2007

Blending Content for South Asian Language Pedagogy Part 2: South Asian Languages on the Internet

Coding & Computation or What s all this about 1s and 0s? File: coding-computation-slides.tex.

ECOM 2325 Computer Organization and Assembly Language. Instructor: Ruba A.Salamah INTRODUCTION

Objectives. Connecting with Computer Science 2

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 01, SPRING 2013

COMP2121: Microprocessors and Interfacing. Number Systems

(URW) ++ UNICODE APERÇU 1. Nimbus Sans Block Name. Regular. Bold. Light Vers Regular. Regular. Bold. Medium. Vers Vers Vers. 4.

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 1: Basic Concepts. Chapter Overview. Welcome to Assembly Language

Discussion. Why do we use Base 10?

ECE 20B, Winter Purpose of Course. Introduction to Electrical Engineering, II. Administration

Chapter 3. Information Representation

Number System. Introduction. Decimal Numbers

Lecture (02) Operations on numbering systems

Data Types Literals, Variables & Constants

Number System (Different Ways To Say How Many) Fall 2016

IBM 370 Basic Data Types

Chap 1. Digital Computers and Information

Binary Values. CSE 410 Lecture 02

Transcription:

COSC 243 Computer Architecture And Operating Systems 1

Dr. Andrew Trotman Instructors Office: 123A, Owheo Phone: 479-7842 Email: andrew@cs.otago.ac.nz Dr. Zhiyi Huang (course coordinator) Office: 126, Owheo Phone: 479-5680 Email: hzy@cs.otago.ac.nz Tutors: Raymond Scurr Reuben Crimp Toby Heitland 2

Course Goals Understand the fundamentals of computer hardware and architecture Understand the fundamentals of operating systems 3

Textbooks Textbook for architecture (Recommended) Stallings, W., Computer Organization and Architecture (8 th or 10th edition), Prentice Hall 2009 (Recommended). Textbook for operating systems (Required) Silberschatz, A., Galvin, P., Gagne, G., Operating System Concepts with Java (8th edition), Addison-Wesley 2009 (Essential). 4

On Reserve in Library Greeg, J.R., Ones and Zeros - Understanding Boolean Algebra, Digital Circuits, and the Logic of Sets, IEEE Press 1998 5

Class Details Two tutorials per week An integral part of the course Internal assessment marks for active participation Home page for the course http://www.cs.otago.ac.nz/cosc243 Lecture notes Tutorial sheets Other resources Consultation times Just drop in 6

Class Details (cont) Linux Introduction If not doing COSC 241, go to a 241 lab this week 18 point paper Means 180 hours of work during 13 weeks 6 contact hours/week * 13 weeks = 78 hours How many non-contact hours are you supposed to put in (at home)? Check email regularly It may contain important notices Lecture notes are online Each week s notes will (normally) be put online on Monday 7

Assessment Internal Assessment Computer architecture: 10% test on data representation in tutorial time (week 3) Sample test is (already) online Operating systems: 10% tutorial time test (in week ~10) Active participation in tutorials - 10% Exam - 70% 8

What is Computer Architecture? The study of the computer hardware We often ignore architecture when doing high-level programming (Java, C) Why study computer architecture? We must know architecture for: Assembly language programming Writing system software such as device drivers To understand what our programs mean 9

Desktop Computing Minority https://www.macrumors.com/2018/02/01/apple-q1-2018-results/ 10

Outline for Computer Architecture Data representation Introduction to digital logic Combinatorial & sequential logic design Overview of a computer and CPU Instruction sets and addressing modes Assembly language programming Primary and secondary storage Control unit and microprogramming More computer architecture Input-Output 11

Overview of Data Representation What is data? Bits, bytes, words Characters Integers Positional notation Binary, octal, hexdecimal notation Conversions between binary, octal, hex, decimal Representation of negative numbers Binary addition and subtraction Representation of real numbers 12

What is Data? Data a fact (information) Data corresponds to discrete facts about phenomena from which we gain information about the world The concept of value is fundamental to data Example values: 25, $256.50, April, This is a sentence, colours and composition in images, tones in music 13

What is Data (cont)? But, values are abstract, they are the interpretations Examples: February. 56. Blue The same value may be represented (written or stored) in many ways. For example: 12 twelve XII 1100 - - - - - - - 14

How is Data Represented In a Computer? The digital computer is binary Everything is stored in one of two states: true, or false which can be thought of as 1 and 0 or a switch which is on or off (voltage, no voltage) or in some chips its a fuse that is OK or blown An instance of a state is called a bit (binary digit) 15

How is Data Represented In a Computer? Values are represented as sequences bits: 1000001 What does this particular sequence mean? How does the computer know what any particular sequence of bits means? 16

How is Data Represented in a Computer? It depends on how you interpret it: 65 (in decimal) A (in ASCII) Or anything else you want it to mean! The computer doesn t know you know 17

Computer Memory The data currently being worked on is (normally) stored in the computer's memory Memory is just like the switchboard in your home, each switch has a number. They re all there all the time and each has a state (on or off). You change the state by flipping the switch. In the computer each data item has: an address or location (the switch number) a value (the state) In high level languages we name some of the locations 18

Bits, Nybbles, Bytes The smallest unit of storage is the bit (1 or 0) For convenience bits are grouped together into larger units. A nybble (nibble, or nyble) is 4 consecutive bits. Its just like a box drawn on the switchboard A byte is 8 consecutive bits (2 nybles) For convenience it is bytes that are given addresses in the (modern) computer (bits and nybbles are too small to work with most of the time). 19

Bits, Nybbles, Bytes 1 bit = 1 switch 1 nybble = 4 switches 1 byte = 8 switches 7 6 5 4 3 2 1 0 0 1 2 3 Computer memory is a switchbox 20

A Word of Memory The word is the number of bits the CPU uses internally. It varies from manufacturer to manufacturer and from CPU to CPU. These days it is usually 32 or 64 bits. Bits Computer 8 Atari 800, Commodore 64, Apple ][ 16 IBM PC XT, Macintosh, DEC VAX 18 DEC PDP 15 32 IBM 370, early Android and ios phones 36 Honeywell, UNIVAC 64 Cray-1, imac, PC, and modern smartphones 21

Characters A character is a written symbol. They are (for English) represented as a single byte. In other languages they can be represented as 2 bytes (or more). Characters include: UPPER CASE LETTERS A C X... lower case letters b g k... Single digits 3 1 9... Special characters! < =... We can join these together in sequences to make (human readable) numbers and words 22

Characters char ch; ch is the variable name (an identifier). It is used to label a particular part of the computer's memory where a byte value is stored. The byte is a sequence of 8 bits, an 8-bit integer [0..255]. During compilation, the name is assigned an address in the computer s memory. That is the location where the data is stored. The meaning of that data depends on how a human interprets it. It might be a small integer, or a character, or a colour, etc. 23

ASCII Character Code How does the computer know that ch is an 'A' and not 'a' or '3' or anything else? It doesn t! 1.The computer uses ch as an integer index into a pre-existing table, e.g. 0001000000101000010001001000001010000010111111101000001010000010 Or, for clarity, an array of bytes like this: unsigned char bits[65] = {16, 40, 68, 130, 130, 254, 130, 130} 2. The computer screen is made up of thousands of little dots called pixels. They are in a rectangular grid, like a table. 24

ASCII Character Code 0001000000101000010001001000001010000010111111101000001010000010 00010000 00101000 01000100 10000010 10000010 11111110 10000010 10000010 x x x x x x x x x xxxxxxx x x x x When the computer is asked to print a character it turns on and off some of those pixels. We then interpret the drawing. We have imposed meaning: We have given it a value 25

ASCII Character Code There are several standard tables that describe what to draw, and fonts that describe how to draw them. ASCII (the American Standard Code for Information Interchange) describes what should be drawn for Roman (English-like) alphabets. For example: A 1000001 (65) a 1100001 (97) 9 0111001 (57) But there are only a few letters, numbers, and punctuation marks. The remanning ASCII codes are non-printing and have other meaning (such as line feed, form feed, tab, etc.). 26

ASCII Character Code (cont) 27

ASCII Character Code (cont) ASCII characters are represented by a 7-bit code. There are, therefore, 128 (2 7 ) possible characters. They are usually stored in memory as a byte with the 8 th bit set to 0. For sorting purposes characters are compared on their numeric value (called the collating sequence). A is before Z but a is after Z! 28

Other Character Codes EBCDIC BAUDOT BCD Extended Binary Coded Decimal Interchange Code. Used with large (old) IBM computers. An old paper tape code Binary coded decimal. 6-bits + check bit. Used on some magnetic tapes. 80 column 12-bit code used on punch-cards. 29

Unicode What about all the non-roman characters? Greek, Arabic, Chinese, Hebrew, Japanese, Thai, etc. Astrology symbols etc. What about characters that represent ideas, concepts, phrases? Emoji, etc. Unicode Developed by The Unicode Consortium Coordinated with ISO/IEC 10646 Originally a 16-bit code (compatible with ASCII) Mapped 16-bit values into glyphs (characters) 65,536 characters were possible Now a 21-bit code with 136,690 characters from 139 scripts Some (many) are reserved 30

Unicode (cont) Defines codes for characters used in the major languages written today. Codes include Latin, Greek, Cyrillic, Armenian, Hebrew, Arabic, Devanagari, Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada, Malayalam, Thai, Lao, Georgian, Tibetan, Japanese Kana, The complete set of modern Korean Hangal, and a unified set of Chinese / Japanese / Korean (CJK) ideographs. 31

Unicode (cont) Version 10.0.0 (most recent) includes new characters for: Masaram Gondi, Nushu, Soyombo, Zanabazar Square, Bitcoin, and others. Now a 21-bit code (1,114,111 allowable codepoints) with 136,690 characters from 139 scripts Some (codepoints) are reserved Can handle composite characters such as those with accent marks, dots, double dots,... 32

Unicode (cont) http://www.unicode.org/charts/pdf/u11d00.pdf 33

Character Strings Homework. How are character strings (e.g. hello world ) stored in a computer? 34