Introduction to Computers -1 st exam- 授課教授:李錫智. 1. Given 12 bits, (a).How many different distinct combinations can we get from these bits? Ans: 2 12 =

Slides:



Advertisements
Similar presentations
Computer Organization Lab 1 Soufiane berouel. Formulas to Remember CPU Time = CPU Clock Cycles x Clock Cycle Time CPU Clock Cycles = Instruction Count.
Advertisements

Assembly Language for Intel-Based Computers, 4 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify and.
1 9/29/06CS150 Introduction to Computer Science 1 Loops Section Page 255.
CSCE 212 Quiz 4 – 2/16/11 *Assume computes take 1 clock cycle, loads and stores take 10 cycles and branches take 4 cycles and that they are running on.
COMP 4—Power Tools for the Mind1 PowerTools What’s in the Box? Turing 1: An Introduction to Programming You will learn elementary computer programming.
Understanding Operating Systems1 Operating Systems Virtual Memory Thrashing Single-User Contiguous Scheme Fixed Partitions Dynamic Partitions.
1 9/20/06CS150 Introduction to Computer Science 1 Review: Exam 1.
Assembly Language for Intel-Based Computers, 4th Edition
Introduction to Computing Systems (1st Exam). 1. [10] What is the range of decimal integers that can be represented by the following given numbers of.
Introduction to Computing CPSC 203 January 24, 2006 Heejin Lim Chapter 1 Chapter 2 (part of)
Javascript II Expressions and Data Types. 2 JavaScript Review programs executed by the web browser programs embedded in a web page using the script element.
Computer and Technology Overview Slides from Essentials of Management Information Systems (5 th ed.), Laudon and Laudon, Prentice-Hall.
WELCOME TO BACK TO SCHOOL NIGHT! Mr. Parnell – Team Venture – 6 th Grade Math Room 109.
CS1430: Programming in C++ Section 2 Instructor: Qi Yang 213 Ullrich
Introduction to Computers -3rd exam- 授課教授:李錫智. Q1 What will the web page look like if the user type 100 、 20 in the numberbox1 、 numberbox2 respectively?
HARDWARE Lesson 2. Components of a computer: 1)A Processor (or CPU) The brain of the computer 2)Memory To remember the programs and data that it uses.
CSU0014 Assembly Languages Homepage: Textbook: Kip R. Irvine, Assembly Language for Intel-Based Computers,
Catie Welsh January 12, 2011 MWF 1-1:50 pm Sitterson
MAC OS – Unit A Page: 10-11, Investigating Data Processing Understanding Memory.
Introduction to Computers 第三次考試 授課教授 : 李錫智. 第一題 [15] Suppose random(x,y) returns an integer randomly between x and y inclusively. Consider the following.
Data Representation and Storage Lecture 5. Representations A number value can be represented in many ways: 5 Five V IIIII Cinq Hold up my hand.
Data Structures -1 st test- March 30, 2015 授課教授:李錫智.
More While Loop Examples CS303E: Elements of Computers and Programming.
1 Buses and types of computer. Paul Strickland Liverpool John Moores University.
Numerical Representation Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg 1.
CSC 110 – Intro to Computing Lecture 8: Computing Components.
Introduction to computers 103 學年度 上學期 Solution of Homework_ch1 授課教授:李錫智.
Chapter 19 Number Systems. Irvine, Kip R. Assembly Language for Intel-Based Computers, Translating Languages English: Display the sum of A times.
Quiz. Quiz One Type your name, ID and address in the.asm file. MUST DO or ZERO SCORE. Change q1 to yourStudentID_q1. You were working as a programming.
Introduction to Programming Instructor: Yong Tang Brookhaven National Laboratory Working on accelerator control (BNL Phone #)
Introduction to Computers -Final exam- 授課教授:李錫智. Q1 Write a function named Reverse that takes a string as input and returns a copy of that string in reverse.
Computer Component. A computer is a machine that is used to store and process data electronically Computer Definition.
Programming, an introduction to Pascal
1 CS1430: Programming in C++ Section 2 Instructor: Qi Yang 213 Ullrich
Introduction to computers 103 學年度 上學期 Solution of Homework_ch12 授課教授:李錫智.
INFORMATION TECHNOLOGY
An Example Architecture. A Paper Computer - Woody Woody's characteristics Word size – 8 bits One word.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patternson and Hennessy Text.
Matlab Data types, input and output. Data types Char: >> a = ‘ Jim ’ Char: >> a = ‘ Jim ’ Numeric: uint8, uint16, uint32, uint64 int8, int16, int32, int64.
Variables and Expressions CMSC 201. Today we start Python! Two ways to use python: You can write a program, as a series of instructions in a file, and.
Textbook C for Scientists and Engineers © Prentice Hall 1997 Available at NUS CO-OP at S$35.10.
Introduction to Programming Python Lab 5: Strings and Output 05 February PythonLab5 lecture slides.ppt Ping Brennan
CPU Central processing unit. INTRODUCTION CPU is a circuit able to execute computer programs, orders and Commands. These commands involve software programs.
Introduction to Computers -1 st exam- 授課教授 : 李錫智 教授.
INTRODUCTION TO COMPUTERS 1st exam solution. Question 1 Please answer the following questions: [5%] Show the page before the user pushes the button. [5%]
COMPUTER SYSTEM A computer system is define as combination of components designed to process data and store files. A computer system consists of four.
Expressions and Data Types Professor Robin Burke.
Computer Performance. Hard Drive - HDD Stores your files, programs, and information. If it gets full, you can’t save any more. Measured in bytes (KB,
Midterm 1 Summary Grading Scale A 93%
INTRODUCTION TO COMPUTERS
Discovering Computers 2008 Fundamentals Fourth Edition Discovering Computers 2008 Fundamentals Fourth Edition Chapter 1 Introduction to Computers.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
Introduction to Computers - 4 th exam- 授課教授:李錫智. Hints: ADD [DR] [SR1] [SR2] DR SR1 SR2 SUB [DR] [SR1] [SR2] DR.
10/25/2005Comp 120 Fall October 25 Review for 2 nd Exam on Tuesday 27 October MUL not MULI Ask Questions!
Number Systems Decimal Can you write 12,045 in expanded form? Base? Allowable digits for each place?
Performance. Moore's Law Moore's Law Related Curves.
Measures of Central Tendency
Introduction to Programming
Assembly Language (CSW 353)
Computer Architecture & Operations I
Data Representation – Instructions
For Monday Read WebCT quiz 18.
One-Dimensional Array Introduction Lesson xx
Computers & Programming Languages
For Wednesday No new reading No quiz.
Topic 1: Data Representation
Computers Inside and Out
Mid-Term Review Good Results Always Answer Questions
Morgan Kaufmann Publishers Computer Performance
Presentation transcript:

Introduction to Computers -1 st exam- 授課教授:李錫智

1. Given 12 bits, (a).How many different distinct combinations can we get from these bits? Ans: 2 12 = 4096 (b). What is the largest unsigned integer we can get from these bits? Please write it out in decimal representation. Ans: = 4095

1.Given 12 bits, (c). What is the smallest unsigned integer we can get from these bits? Please write it out in decimal representation. Ans: 0 (d). John wrote a book consisting of 2097 pages. Each page contains 500 characters. Suppose each character is represented by a byte. John wants to store his book in a 1 MB memory. Is the memory big enough for the book? Why or why not? Ans: 1MB = 2 20 Bytes = Bytes 2097*500*1 = < 1MB, so it’s enough.

1-(e). Mary wants to represent any integer between -16 and 15. How many bits does Mary need to use? Ans: -16~15 There have 32 integers, so it just need 5 bits to repersent them.

2. What does Var represent in each case: (a). Var = “ is the sum”; (b). Var = 10 + “ is the sum” + 24; (c). Var = “The sum is “ ; (d). Var = “The sum is “ + ( ); (e). Var = “” “ is the sum”; Ans: (a). 34 is the sum ( b). 10 is the sum24 (c). The sum is 1024 (d). The sum is 34 (e) is the sum

3. Suppose the speed of instruction execution is proportional to the clock rate of the CPU. If a program is run by a 1.5GHz CPU in 30 minutes, how soon will it be run by a 2.5GHz CPU? Ans:, X=18

4. What does the following web page look like on the screen? How Great is HTML Hello! EE-NSYSU Freshmen 200 Senior 20 How wonderful the department is!

Ans:

5. Write a web page to show the following table on the screen. Ans: Tuesday Chinese Physics TuesdayChinese Physics

6. Create a web page that can be used to compute a student’s overall average for a course. Your page should prompt the user to enter his or her homework score, test 1 score, test 2 score, test 3 score, and test 4 score, and compute and show the overall average on the screen as shown below (Assume the grade weightings for homework is 10%, test 1 20%, test 2 20%, test 3 25%, and test 4 25%.) Homework score: 80 Test 1 score: 40 Test 2 score: 60 Test 3 score: 80 Test 4 score: 100 Overall average: 73

Ans: temp=prompt("Enter the homework score: ", ""); hw=parseFloat(temp); temp=prompt("Enter the test1 score: ", ""); t1=parseFloat(temp); temp=prompt("Enter the test2 socre: ", ""); t2=parseFloat(temp); temp=prompt("Enter the test3 score: ", ""); t3=parseFloat(temp); temp=prompt("Enter the test4 socre: ", ""); t4=parseFloat(temp);

avg=(hw*0.1)+(t1*0.2)+(t2*0.2)+(t3*0.25)+(t4*0.25); document.write("Homework score: "+hw+" "); document.write("Test 1 score: "+t1+" "); document.write("Test 2 score: "+t2+" "); document.write("Test 3 score: "+t3+" "); document.write("Test 4 score: "+t4+" "); document.write(" "); document.write("Overall average: "+avg);

7. What does the following web page look like on the screen (Suppose the user types in 12)? Compute Square Var = prompt(“Enter the input:”, “”); Var = parseFloat(Var); document.write(“ ”); document.write(Var + “*” + Var + “ = “ + Var*Var); document.write(“ ”);

Ans: