Introduction to Computer Science

Similar documents
Chapter 1. Data Storage Pearson Addison-Wesley. All rights reserved

Bits and Bit Patterns

Data Storage. Slides derived from those available on the web site of the book: Computer Science: An Overview, 11 th Edition, by J.

Jianhui Zhang, Ph.D., Associate Prof. College of Computer Science and Technology, Hangzhou Dianzi Univ.

1.1 Bits and Bit Patterns. Boolean Operations. Figure 2.1 CPU and main memory connected via a bus. CS11102 Introduction to Computer Science

1. Which of the following Boolean operations produces the output 1 for the fewest number of input patterns?

Experimental Methods I

Objectives. Connecting with Computer Science 2

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

Understanding IO patterns of SSDs

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

SHANDONG UNIVERSITY 1

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

计算机信息表达. Information Representation 刘志磊天津大学智能与计算学部

DATA STORAGE. Chapter One. Chapter Summary. Comments

Introduction to Computer Networks

武汉大学 学年度第 1 学期 多核架构及编程技术 试卷(A)

实验三十三 DEIGRP 的配置 一 实验目的 二 应用环境 三 实验设备 四 实验拓扑 五 实验要求 六 实验步骤 1. 掌握 DEIGRP 的配置方法 2. 理解 DEIGRP 协议的工作过程

计算机组成原理第二讲 第二章 : 运算方法和运算器 数据与文字的表示方法 (1) 整数的表示方法. 授课老师 : 王浩宇

Discussion. Why do we use Base 10?

Information Science 1

Final Labs and Tutors

An Overview of the Computer System. Kafui A. Prebbie 24

ICP Enablon User Manual Factory ICP Enablon 用户手册 工厂 Version th Jul 2012 版本 年 7 月 16 日. Content 内容

Introduction to Computers and Programming. Numeric Values

INTRODUCTION TO COMPUTERS

Previous on Computer Networks Class 18. ICMP: Internet Control Message Protocol IP Protocol Actually a IP packet

Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates. Invitation to Computer Science, C++ Version, Third Edition

UNIT 7A Data Representation: Numbers and Text. Digital Data

如何查看 Cache Engine 缓存中有哪些网站 /URL

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

C H A P T E R 1. Introduction to Computers and Programming

National 5 Computing Science Software Design & Development

Data Representation. Types of data: Numbers Text Audio Images & Graphics Video

DATA 301 Introduction to Data Analytics Data Representation. Dr. Ramon Lawrence University of British Columbia Okanagan

Topics. Hardware and Software. Introduction. Main Memory. The CPU 9/21/2014. Introduction to Computers and Programming

Computer Organization and Levels of Abstraction

Bits, bytes, binary numbers, and the representation of information

Digital Fundamentals

The Design of Everyday Things

Unit 2: Data Storage CS 101, Fall 2018

Computer Organization and Levels of Abstraction

CHINA VISA APPLICATION CONCIERGE SERVICE*

ZWO 相机固件升级参考手册. ZWO Camera Firmware Upgrade reference manual. 版权所有 c 苏州市振旺光电有限公司 保留一切权利 非经本公司许可, 任何组织和个人不得擅自摘抄 复制本文档内容的部分或者全部, 并

第二小题 : 逻辑隔离 (10 分 ) OpenFlow Switch1 (PC-A/Netfpga) OpenFlow Switch2 (PC-B/Netfpga) ServerB PC-2. Switching Hub

CMSC 104 -Lecture 2 John Y. Park, adapted by C Grasso

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

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two Solutions 26 February 2014

CMSC 1513 Lecture 1.2

三 依赖注入 (dependency injection) 的学习

漂亮的测试. By Alberto Savoia 代码之美 第七章 史际帆

1. DWR 1.1 DWR 基础 概念 使用使用 DWR 的步骤. 1 什么是 DWR? Direct Web Remote, 直接 Web 远程 是一个 Ajax 的框架

学习沉淀成长分享 EIGRP. 红茶三杯 ( 朱 SIR) 微博 : Latest update:

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

[301] Bits and Memory. Tyler Caraza-Harter

Lecture 23 Introduction to Paging

3 Data Storage 3.1. Foundations of Computer Science Cengage Learning

Inf2C - Computer Systems Lecture 2 Data Representation

Digital Fundamentals

Software and Hardware

Declaration of Conformity STANDARD 100 by OEKO TEX

What s inside your computer? Session 3. Peter Henderson

Computer Organization

Data Representation 1

3dvia Composer Solidworks

Command Dictionary CUSTOM

Bi-monthly report. Tianyi Luo

Using sticks to count was a great idea for its time. And using symbols instead of real sticks was much better.

Chapter 7: Deadlocks. Operating System Concepts 9 th Edition

Representing Images Representing Sound. *1.5 The Binary System. Binary Notation Binary Addition Fractions in Binary. *1.

Birkbeck (University of London) Department of Computer Science and Information Systems. Introduction to Computer Systems (BUCI008H4)

Concept of Memory. The memory of computer is broadly categories into two categories:

CHW 261: Logic Design

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

OpenCascade 的曲面.

武汉大学 学年度第 2 学期 多核架构及编程技术 试卷(A)

LOGIC DESIGN. Dr. Mahmoud Abo_elfetouh

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Number System. Introduction. Decimal Numbers

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

OCR J276 GCSE Computer Science

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two 26 February 2014

Electronic Data and Instructions

Lecture Objectives. Introduction to Computing Chapter 0. Topics. Numbering Systems 04/09/2017

Number Systems. Decimal numbers. Binary numbers. Chapter 1 <1> 8's column. 1000's column. 2's column. 4's column

Chapter 11 SHANDONG UNIVERSITY 1

Introduction to Computer Science. Homework 1

Logic and Computer Design Fundamentals. Chapter 1 Digital Computers and Information

D I G I T A L C I R C U I T S E E

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

Outline. Motivations (1/3) Distributed File Systems. Motivations (3/3) Motivations (2/3)

Chapter 1: Why Program? Computers and Programming. Why Program?

15110 PRINCIPLES OF COMPUTING SAMPLE EXAM 2

Digital Fundamentals

Birkbeck (University of London) Department of Computer Science and Information Systems. Introduction to Computer Systems (BUCI008H4)

CDS Computing for Scientists. Midterm Exam Review. Midterm Exam on October 22, 2013

OTAD Application Note

Introduction to Computers. Joslyn A. Smith

CS 105 Review Questions #3

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010

Transcription:

Introduction to Computer Science 郝建业副教授 软件学院 http://www.escience.cn/people/jianye/index.html

Lecturer Jianye HAO ( 郝建业 ) Email: jianye.hao@tju.edu.cn Tutor: Li Shuxin ( 李姝昕 ) Email: 957005030@qq.com

Outline of the Course Week 5: Data Storage Week 6-7: Data Manipulation Week 8: Operating Systems Week 9: Lab Week 10: Networks and the Internet Week 11: Data Abstractions Week 12: Lab Week 13: Algorithms Week 14: Lab Week 15: Artificial Intelligence (45B-310)

Chapter 1: Data Storage

Chapter 1: Data Storage 1.1 Bits and Their Storage 1.2 Main Memory 1.3 Mass Storage 1.4 Representing Information as Bit Patterns 1.5 The Binary System 0-5

Chapter 1: Data Storage (continued) 1.6 Storing Integers 1.7 Storing Fractions 1.8 Communications Errors 0-6

Bits and Bit Patterns Bit: Binary Digit (0 or 1) Bit Patterns are used to represent information. Numbers Text characters Images Sound And others 0-7

Boolean Operations Boolean Operation: An operation that manipulates one or more true/false values Specific operations AND OR XOR (exclusive or) NOT 0-8

Figure 1.1 The Boolean operations AND, OR, and XOR (exclusive or) 0-9

Gates Gate: A device that computes a Boolean operation Often implemented as (small) electronic circuits Provide the building blocks from which computers are constructed VLSI (Very Large Scale Integration) 0-10

Example: A pictorial representation of AND, OR, XOR, and NOT gates as well as their input and output values 0-11

Flip-flops Flip-flop: A circuit built from gates that can store one bit. One input line is used to set its stored value to 1 One input line is used to set its stored value to 0 While both input lines are 0, the most recently stored value is preserved 0-12

A simple flip-flop circuit 0-13

Setting the output of a flip-flop to 1 0-14

Setting the output of a flip-flop to 1 (continued) 0-15

Setting the output of a flip-flop to 1 (continued) 0-16

Another way of constructing a flip-flop 0-17

Hexadecimal Notation Hexadecimal notation: A shorthand notation for long bit patterns Divides a pattern into groups of four bits each Represents each group by a single symbol Example: 10100011 becomes A3 0-18

The hexadecimal coding system 0-19

Main Memory Cells Cell: A unit of main memory (typically 8 bits which is one byte) Most significant bit: the bit at the left (highorder) end of the conceptual row of bits in a memory cell Least significant bit: the bit at the right (loworder) end of the conceptual row of bits in a memory cell 0-20

The organization of a byte-size memory cell 0-21

Main Memory Addresses Address: A name that uniquely identifies one cell in the computer s main memory The names are actually numbers. These numbers are assigned consecutively starting at zero. Numbering the cells in this manner associates an order with the memory cells. 0-22

Memory cells arranged by address 0-23

Memory Terminology Random Access Memory (RAM): Memory in which individual cells can be easily accessed in any order Dynamic Memory (DRAM): RAM composed of volatile memory 0-24

Measuring Memory Capacity Kilobyte: 2 10 bytes = 1024 bytes Example: 3 KB = 3 times1024 bytes Megabyte: 2 20 bytes = 1,048,576 bytes Example: 3 MB = 3 times 1,048,576 bytes Gigabyte: 2 30 bytes = 1,073,741,824 bytes Example: 3 GB = 3 times 1,073,741,824 bytes TB, PB, EB, ZB 0-25

Mass Storage On-line versus off-line Typically larger than main memory Typically less volatile than main memory Typically slower than main memory 0-26

Mass Storage Systems Magnetic Systems Disk Tape Optical Systems CD DVD Flash Technology Flash Drives Secure Digital (SD) Memory Card DNA technology 0-27

A magnetic disk storage system 0-28

Magnetic tape storage 0-29

CD storage 0-30

Representing Text Each character (letter, punctuation, etc.) is assigned a unique bit pattern. ASCII: Uses patterns of 7-bits to represent most symbols used in written English text ISO developed a number of 8 bit extensions to ASCII, each designed to accommodate a major language group Unicode: Uses patterns of 16-bits to represent the major symbols used in languages world wide 0-31

The message Hello. in ASCII 0-32

Representing Numeric Values Binary notation: Uses bits to represent a number in base two Limitations of computer representations of numeric values Overflow: occurs when a value is too big to be represented Truncation: occurs when a value cannot be represented accurately 0-33

Representing Images Bit map techniques Pixel: short for picture element RGB Luminance and chrominance Vector techniques Scalable TrueType and PostScript 0-34

Representing Sound Sampling techniques Used for high quality recordings Records actual audio MIDI Used in music synthesizers Records musical score 0-35

Figure 1.14 The sound wave represented by the sequence 0, 1.5, 2.0, 1.5, 2.0, 3.0, 4.0, 3.0, 0 0-36

The Binary System The traditional decimal system is based on powers of ten. The Binary system is based on powers of two. 0-37

The base ten and binary systems 0-38

Decoding the binary representation 100101 0-39

An algorithm for finding the binary representation of a positive integer 0-40

Applying the algorithm to obtain the binary representation of thirteen 0-41

The binary addition facts 0-42

Example 58+27 58 + 27 85 111010 + 11011 1010101

Decoding the binary representation 101.101 0-44

Storing Integers Two s complement notation: The most popular means of representing integer values Excess notation: Another means of representing integer values Both can suffer from overflow errors. 0-45

Two s complement notation systems 0-46

Coding the value -6 in two s complement notation using four bits 0-47

Addition problems converted to two s complement notation 0-48

Overflow Another Example 5 + 4-4 + -5 0101 + 0100 1001 1100 + 1011 10111-7?

Question 二进制补码记数 : 一个正数和一个负数相加会产生溢出吗? 请说明理由

An excess eight conversion table 0-51

An excess notation system using bit patterns of length three 0-52

Question 数值 9 可以用余 8 记数法表示吗? 请说明理由 数值 4 可以用余 4 记数法表示吗? 请说明理由

Storing Fractions Floating-point Notation: Consists of a sign bit, a mantissa field, and an exponent field. Related topics include Normalized form Truncation errors 0-54

Floating-point notation components 0-55

Encoding the value 3 8 3/8 Original representation 0 0.0 1 1 Base two representation 1 1 0 0 Raw bit pattern 0 0 1 1 1 1 0 0 Sign bit Exponent Mantissa

Encoding the value 2 3/4 2 3 / 4 Original representation 1 0.1 1 Base two representation 1 0 1 1 Raw bit pattern 0 1 1 0 1 0 1 1 Sign bit Exponent Mantissa

Encoding the value 2 5 8 0-58

Communication Errors Parity bits (even versus odd) ( 奇偶校验位 ) Error correcting codes ( 纠错编码 ) 0-59

The ASCII codes for the letters A and F adjusted for odd parity 0-60

An error-correcting code 0-61

Decoding the pattern 010100 using the code in previous slide 0-62

Question 如果设计一种编码, 使得每个模式和其他模式之间的汉明距离为 5, 请问最多可以发现几个错误, 最多可以纠错几位?