MultiBooks - Tổng hợp IT - PC part 157 pdf

5 44 0
MultiBooks - Tổng hợp IT - PC part 157 pdf

Đang tải... (xem toàn văn)

Thông tin tài liệu

= 256 + 32 + 8 + 4 + 1 =(301) 10  2 nd step: convert to octal 301 8 61 37 8 (301) 10 = (455) 8 (100101101) 2 = (455) 8 - To hexadecimal 110111011011 1 st step = 1.2 11 + 1.2 10 + 1.2 8 + 1.2 7 + 1.2 6 + 1.2 4 + 1.2 3 + 1.2 1 + 1.2 0 = 2048+ 1024 + 256 + 158 + 64 + 16 + 8 + 2 + 1 = (3547) 10 2 nd step 3547 16 384 221 16 27 61 (3547) 10 = (CCA) 16 (110111011011) 2 = (CCA) 16 1. Convert into binary and display the answer in normalized exponential form 247 1 123 1 61 1 30 1 15 1 7 1 3 1 1 1 0 1 (247) 10 = (11110111) 2 = 0. 1111011 x 2 normalized exponential form Question 3. Integer and Floating – point arithmetic? 5 5 4 11 13 13 1. Floating – point Addition a. (0.1011 x 2 5 ) + (0.1001 x 2 5 ) = (0.1011 + 0. 1001) x 2 5 = 1.0100 x 2 5 = 0.10100 x 2 6 b. (0.1001 x 2 3 ) + (0.1110 x 2 5 ) = (0.001001 x 2 5 ) + (0.1110 x 2 5 ) = (0.001001 + 0.111000) x 2 5 = 1.000001 x 2 5 = 0.1000 x 2 6 (here have truncation) (0.1000001 x 2 6 ) 2. Floating – point subtraction a. (0.1110 x 2 7 ) – (0.1100 x 2 7 ) = 0.0010 x 2 7 = 0. 10 x 2 5 b. (0.1001 x 2 8 ) – ( 0.1000 x 2 5 ) = (0.1001 x 2 8 ) – ( 0.0001 x 2 8 ) = 0.1000 x 2 8 3. Floating – point multiplication a. (0.1010 x 2 3 ) x (0.1100 x 2 3 ) = (0.1010 x 0.1100) x 2 6 = 0.01111 x 2 6 = 0.1111 x 2 5 b. (0.11110 x 2 3 ) x ((0.01011) x 2 4 ) = (0.11110 x 0. 01011) x 2 7 = 0.001111 x 2 7 = 0.1111 x 2 5 4. Floating – point division. a. (0.11010 x 2 6 ) : (0.001 x 2 6 ) = (0.11010 x 2 6 ) : (1 x 2 3 ) = 0.1101 x 2 6 : 1x 2 3 = 0.1101 x 2 3 b. (0.110111 x 2 6 ) : (0.1001 x 2 4 ) = (0.110111 : 0.1001) x 2 2 = (1101.11 : 1001) x 2 2 = 1.100001 x 2 2 = 0.1100001 x 2 3 Chapter 3: TYPES OF INSTRUCTION AND ADDRESSING. Question 1. Types of instructions used in CS? 1. Arithmetic instructions. Arithmetic instructions include directives to the computers to perform additions, subtraction, multiplications, divisions and exponentiations. 2. Input/ output instructions. They direct the computer to read data values from the specified input devices into the main store for processing. They also include instructions to write the contents of memory locations holding the result of processing to a specified output device. 3. Decision or control instructions. Most data processing application will contain situations where alternative calculations or procedures will have to be executed based on the result of condition tests carried out. 4. Data handling instructions They include the copying of the content of one memory location to another or setting a memory locations to an initial value. Also include the management or insertion of characters into data items Examples of such instructions include branch instructions, jump instruction & stop instruction. Question 2. Types of addressing? 1. Direct addressing The operands of each machine instructions is used to retrieve the data 2. Indirect addressing The operands is used to specify the memory address which contains the address of the data to be processed Op – code OP – CODE OPERAND OP – CODE OPERAND 12345 Data item 12345 Data item Main storage Direct addressing Indirect addressing 3. Indexed addressing - The main applications of this type of addressing technique is to enable to access of sequential locations in memory that are adjacent to each other - Each adjcent memory address has value n+1, where n is the address of the previous location - When the first of the location have been accessed, the next memory location in sequence is accessed by simply increasing the add of the present location by 1 & using accessing it - The starting address of the series of locations is specified in the operand of the instruction - In order to access the next location in sequence, the content of the index register is increased by 1 a added to the opreand address - This is done repeatedly until the last memory location in the series is processed Indexed addressing. OP – CODE OPERAND Index Register Chapter 4: PROGRAMMING LANGUAGES. Question 1. Program and level of language? Program is group of constructions that is linked together to perform specific task. It’s necessary for a computer program to be written in a “PL” because at a computer program is created by a programing using a sys analyst’s specification of the job in the hand. 1. Machine language - ML is the set of bit(0,1) that can performed considered by CPU - Ads  fast  short prog  store in small memory - Dis  difficult to understand & remember its code  takes a lot of time to programming  difficult to use 2. Low level language Data 1 Data 2 Data 3 Data 4 - LLL is used to dercribe exactly procedure of performance of CPU at certain time - Features:  Instruction is written by natrural English or natural language  More powerful and so the prog is shortest  Need less instruction  Is a one to one relationship between the written instruction and the machine instructions  It’s instruction tend to be machine. It runs in OS - Ads:  Easy to write  Easy to understand  Known the processing data in CPU  Prog writing is shortset - Dis:  Must be complier  The time of running prog is longer than machine language 3. High level language - HLL was developed in order to further easy the work of programmers by making the programming language more procedure oriented - Features:  The statements of HLL are closer to natural english or other natural language  A HLL source program must be translated into machine code by means of a compiler or an interpreter - Ads:  Easy to wirte  Easy to understand  May be used for everybody  Closed to natural languages english language - Dis:  Must be interpreter by compiler or an interpreter before processing by the computer  The prog is long  The time to run the prog is longer than low level language . Machine language - ML is the set of bit(0,1) that can performed considered by CPU - Ads  fast  short prog  store in small memory - Dis  difficult to understand & remember its code . to one relationship between the written instruction and the machine instructions  It s instruction tend to be machine. It runs in OS - Ads:  Easy to write  Easy to understand  Known. present location by 1 & using accessing it - The starting address of the series of locations is specified in the operand of the instruction - In order to access the next location in sequence,

Ngày đăng: 08/07/2014, 09:20

Tài liệu cùng người dùng

Tài liệu liên quan