* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Mac: new
Survey
Document related concepts
Transcript
Introduction to Management Information Systems Chapter 3 Computer Basics HTM 304 Spring 06 Computer Basics Hardware and Software Basics – group field study. Digital Boolean Logics Binary Number Systems Computer Data 2 Introduction to Digital We are in the digital age Digital TV, Digital Phone, Digital Music Channel, … What is digital? “analog” – sine wave Value -- Amplitude many possible values 3 “Digital” – square wave Value: -- High / Low voltage two possible values Benefit of using digital signal Signal can be stored and processed more precisely Easy to recover from small interference Signal Weakens During Transfer Weaken, but still recoverable Allow complicated computation task 4 Boolean Logics Square wave only contain two signals: High Voltage, representing Logic 1 Low Voltage, representing Logic 0 Logic 0 Logic 1 Electric Signals 0V 5V Logics False True Numeral Digits 0 1 All the complicated function a computer used is achieved via digital circuits combined with basic logic gates 5 Logic Gates Basic Logic Gate Products (e.g. TI 7645) Example: a chip with four and gates 1 1 1 A variety chips and circuits composes a digital circuit, achieving certain functionality, e.g. a computer 6 Logic Functions (1) And Function: If both (all) inputs are True, then the output is True. Example: If tomorrow is rainy AND you have to go to work, you should prepare for an umbrella. Rainy? 1– True, 0 – False Work tomorrow? 1– True, 0 – False Need an umbrella? 1– True, 0 – False Formula: 0 and 0 = 0 0 and 1 = 0 1 and 0 = 0 1 and 1 = 1 Rule: 0 and anything is still 0, 1 and anything is anything. 7 Logic Functions (2) Or Function: If either (any) input is True, then the output is True. Example: If I get a raise OR the bank gives me a loan, then I can buy a new car. Raise? 1– True, 0 – False Loan? 1– True, 0 – False New Car? 1– True, 0 – False Formula: 0 or 0 = 0 0 or 1 = 1 1 or 0 = 1 1 or 1 = 1 Rule: 0 or anything is still anything, 1 or anything is 1. 8 Logic Functions (3) Not Function: If input is True, then the output is False. Example: If your final score if below 60, you cannot pass. <60? pass? 1– True, 0 – False 1– True, 0 – False Formula: not 0 = 1 9 not 1 = 0 Exercise Handout: Set 1 Logic Operations 10 Binary Number System How computer computes with only 0-1s? In decimal number system, there are 10 unique digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 In binary number system, there are only 2 unique digits: 0 and 1 Base 10 (decimal) Base 2 (binary) 0 1 2 3 4 5 6 7 0 1 ? ? ? ? ? ? Exercise: Handout Set 2. 11 Binary-to-Decimal Conversion (1) Rule 1: 10...0 n 0 s 2 2 n 10 Eg: 102=210, 1002=410, 1002=810 10,000,000,0002 = ? Rule 2: 1...1 2 2n 1 n 1s Eg: 112=22-1=310, 1112=23-1=710 1,111,111,1112 = ? 12 10 Binary-to-Decimal Conversion Think what a decimal number really represent? 53710 = 5*100 + 3*10 + 7 = 5 * 102+ 3*101+7*100 -- base 10 system 8453310 = 8*104 +4*103 + 5*102 + 3*101+3*100 Binary System – base 2 system 10012 = 1*23+ 0*22 + 0*21+1*20 = 8 + 0 + 0 + 1 = 910 Use the following table to convert: 13 Binary number 1 0 0 1 Place Value 8 4 2 1 8 0 0 1 Sum up the last row to get the decimal number 910 Exercise Handout Set 3 14 Decimal-to-Binary Conversion How to represent 9810 using a binary number? A short division method – divide the number by 2 2) 98 remainder 2) ________ 49 0 24 2) ________ 1 12 2) ________ 0 6 2) ________ 0 Read the remainders from below to 3 2) ________ 0 above: 9810 = 11000102 1 2) ________ 1 0 1 Continue until you get 0 15 Exercise Convert the following decimal numbers to binary numbers 127 96 231 37 51 255 16 Binary Addition Basic Rules: 0+0=0 0+1=1 1 + 1 = 0 and a carry of 1 1 + 1 + 1 = 1 and a carry of 1 Examples 1001 + 0011 1100 17 1110 + 1000 10110 1010 + 0111 10001 Exercises Handout Set 4 18 Digital Signals in computer How computer recognizes numbers physically? 19 Binary Numeral System Computers represent data using binary digits, called bits. Bits are used for computer data because they are easy to represent physically. A switch can either be closed or open. Computers use bits for two purpose: Instruction and Data For example: a sequence 0111100010001110 means adding two numbers together. 20 Computer Data All computer data are represented by bits. The data can be numbers, characters, currency amounts, photos, recordings, or whatever. Bits are grouped into 8-bit chunks called bytes. The pros and cons of having fixed size bytes. What is the largest value for a byte? E.g. An IP address uses 4 bytes storage 21 Exercise: Computer A is broadcasting its IP address 144.2.45.7 to the network. How the electric signals are sent via the network? Binary Sequence 10010011 00000010 00101101 0000 0111 1 0 01 0 0 110 0 0 0 00 100 0 10 1 10 1 00 00 0 11 1 22 Using Bits to Represent Information Use Character Representation Codes ASCII - American Standard Code for Information Interchange Check out the ASCII Table for digital sequence of the word “Hello” Letters Bytes “H” 0100 1000 “e” 0110 0101 “l” 0110 1100 “l” 0110 1100 “o” 0110 1111 Each letter (“character”) is represented using 1 Byte = 8 bits 23 Important Storage-Capacity Terminology 24 Exercise: 1. Estimate the size of a text file with approximately 1000 characters 2. A 256 color bitmap graph uses one byte to store color information for each pixel. Estimate the size of a bitmap file with 800*600 pixels Ambiguity of Binary Data A binary sequence 0100 0001 can be used to represent both decimal value 65 and the character A This ambiguity is more than curiosity; virus authors and other cyber-criminal use it to their advantage. Sometimes, bit-level encryption is used to insure secure data storage and transmission over the net. Binary Logic Operation is used 25 A simple example of encryption E.g. Reverse the logic on the 1st and 3rd bits from the right 26 Letters Bytes Encrypted Code Encrypted Letter “H” 0100 1000 0100 1101 M “e” 0110 0101 0110 0000 ` “l” 0110 1100 0110 1001 i “l” 0110 1100 0110 1001 i “o” 0110 1111 0110 1010 j Exercise Handout Set 5 27 Summary Learning Binary to understand more about computer Logic Operations: AND, OR, NOT Count Binaries Conversion: binary decimal, decimal binary Binary addition Use bytes to represent information 1 byte = ? bits Check ASCII table for information 28 Field Study Assignment Read the handout and Chapter 3 Find your group member Prepare a presentation to address the questions in the handout. 29