EXPERIMENT NO: 01. Write a program to convert decimal number to binary and vice versa.

Size: px
Start display at page:

Download "EXPERIMENT NO: 01. Write a program to convert decimal number to binary and vice versa."

Transcription

1 EXPERIMENT NO: 01 PROBLEM STATEMENT: Write a program to convert decimal number to binary and vice versa. THEORY: A number system is a systematic way to represent numbers with symbolic characters and uses a base value to conveniently group numbers in compact form. The most common number system is decimal, which has a base value of 10, and a symbolic character set of 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. However, there are other number systems, and they can be more efficient to use for a specific purpose. For example, following table shows different number systems: NUMBER SYSTEM BASE VALUE SYMBOLIC CHARACTER SET Binary 2 0,1 Octal 8 0, 1, 2, 3, 4, 5, 6, 7 Decimal 10 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 Hexadecimal 16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F ALGORITHM: Conversion of Decimal to Binary- Step 1 - Divide the decimal number by 2 Step 2 - Get the remainder from Step 1 as the rightmost digit (least significant digit) of binary number. Step 3 - Divide the new quotient by 2. Step 4 - Record the remainder from Step 3 as the next digit (to the left) of the binary number. Step 5: Repeat Steps 3 and 4, until the quotient becomes zero in Step 3. EXAMPLE Decimal Number: Calculating Binary Equivalent: Step Operation Result Remainder Step 1 29 / Step 2 14 / Step 3 7 / Step 4 3 / Step 5 1 / 2 0 1

2 As mentioned in Steps 2 and 4, the remainders have to be arranged in the reverse order so that the first remainder becomes the least significant digit (LSD) and the last remainder becomes the most significant digit (MSD). Decimal Number: = Binary Number: Conversion of binary to Decimal- Step 1 - Determine the positional value of each digit (this depends on the position of the digit and the base of the number system). Step 2 - Multiply the obtained positional values (in Step 1) by the digits in the corresponding position. Step 3 - Sum the products calculated in Step 2. The total is the equivalent value in decimal. EXAMPLE ( ) = (233) 10 CONCLUSION: Implementation of Binary to Decimal and Decimal to Binary conversion performed successfully.

3 EXPERIMENT NO: 02 PROBLEM STATEMENT: Write a program to implement multiplication of two unsigned binary numbers. THEORY: Compared with addition and subtraction, multiplication is a complex operation, whether performed in hardware or software. Multiplication of two unsigned number is done as follows: 1. The partial products are easily defined. When the multiplier bit is 0, the partial product is 0.When the multiplier is 1, the partial product is the multiplicand. 2. Multiplication involves the generation of partial products, one for each digit in the multiplier. These partial products are then summed to produce the final product. 3. The total product is produced by summing the partial products. For this operation, each successive partial product is shifted one position to the left relative the preceding partial product. 4. The multiplication of two n-bit binary integers results in a product of up to 2n bits in length. Example : Figure shows a possible implementation employing these measures. The multiplier and multiplicand are loaded into two registers (Q and M). A third register, the A register, is also needed and is initially set to 0. There is also a 1-bit C register, initialized to 0, which holds a potential carry bit resulting from addition. The operation of the multiplier is as follows. Control logic reads the bits of the multiplier one at a time. If Q 0 is 1, then the multiplicand is added to the A register and the result is stored in the A register, with the C bit used for overflow. Then all of the bits of the C, A, and Q registers are shifted to the right one bit, so that the C bit goes into A n-1 and A0 goes into Q n-1 goes into and is lost. If Q 0 is 0, then no addition is performed, just the shift. This process is repeated for each bit of the original multiplier. The resulting -bit product is contained in the A and Q registers.

4 The flowchart for unsigned binary multiplication is as follows: CONCLUSION: The program to perform multiplication of two binary numbers was performed and output obtained.

5 EXPERIMENT NO: 03 PROBLEM STATEMENT: Write a program to implement multiplication of 2, two s complement numbers using Booth s algorithm. THEORY: Booth's multiplication algorithm is a multiplication algorithm that multiplies two signed binary numbers in two's complement notation. The algorithm was invented by Andrew Donald Booth in 1950 while doing research on crystallography at Birkbeck College in Bloomsbury, London. Booth used desk calculators that were faster at shifting than adding and created the algorithm to increase their speed. Booth's algorithm examines adjacent pairs of bits of the N-bit multiplier Y in signed two's complement representation, including an implicit bit below the least significant bit, y -1 = 0. For each bit y i, for i running from 0 to N-1, the bits y i and y i- 1 are considered. Where these two bits are equal, the product accumulator P is left unchanged. Where y i = 0 and y i-1 = 1, the multiplicand times 2 i is added top; and where y i = 1 and y i-1 = 0, the multiplicand times 2 i is subtracted from P. The final value of P is the signed product. The representation of the multiplicand and product are not specified; typically, these are both also in two's complement representation, like the multiplier, but any number system that supports addition and subtraction will work as well. As stated here, the order of the steps is not determined. Typically, it proceeds from LSB to MSB, starting at i = 0; the multiplication by 2 i is then typically replaced by incremental shifting of the P accumulator to the right between steps; low bits can be shifted out, and subsequent additions and subtractions can then be done just on the highest N bits of P. [1] There are many variations and optimizations on these details. The algorithm is often described as converting strings of 1's in the multiplier to a high-order +1 and a low-order 1 at the ends of the string. When a string runs through the MSB, there is no high-order +1, and the net effect is interpretation as a negative of the appropriate value.

6 Flow Chart/Diagram of Booth's Algorithm of Multiplication:- Example of Booth's Multiplication Algorithm:-Multiply 7 with 3 with the help of Booth's Algorithm. Result= AQ = ( ) 2 = (21) 10 CONCLUSION: The program to perform multiplication of two signed numbers using Booth s Algorithm was performed and output obtained.

7 PROBLEM STATEMENT: EXPERIMENT NO: 04 Write a program to implement division of two unsigned numbers using Restoring algorithm. THEORY: The division operation consists of a series of subtractions of the divisor from the partial remainder, which are only executed if the divisor is smaller than the partial remainder, when the digit of the quotient is 1; otherwise, the corresponding digit of the quotient is 0. Consider the division of two numbers: 147 / 11 Flow chart for Restoring division algorithm

8 Restoring Division Example: 14/3 Result is Remainder in A= (0010) 2 = (2) 10 Quotient in Q= (0100) 2 = (4) 10 CONCLUSION: Implementation of multiplication using restoring Algorithm was performed successfully and output obtained.

9 EXPERIMENT NO: 05 PROBLEM STATEMENT: Write a program to implement division of 2, two s complement numbers using non restoring algorithm. THEORY: This algorithm works for both positive and negative number division. In this, we have to represent dividend and divisor in two s complement number. Example Dividend (A) = 1001, i.e. 7, and Divisor (B) = 0011, i.e. 3. Initialization: Set Register A = Dividend = 1111 Set Register Q = Dividend = 1001 (So AQ = ) Set M = Divisor = 0011, M' = 2's complement of M = 1101 Set Count =4, since 4 digits operation is being done here. After this we start the algorithm, which is shown below: A Q Action Initial state Left shift A, Q A=A+M (A and M have different signs) Restore A and Q 0 = cycle Left shift A, Q A=A+M (A and M have different signs) Restore A and Q 0 = cycle Left shift A, Q A=A+M (A and M have different signs) set Q0= cycle Left shift A, Q A=A+M (A and M have different signs) Restore A and Q 0 = cycle 4 Result is: Remainder is in A= (1111) 2 = (-1) 10 Quotient = Two s complement of Q = (1110) 2 = (-2) 10

10 ALGORITHM: Step 1: Load the divisor into M register and dividend in A, Q registers. The dividend must be expressed as 2n bit two s complement number. For ex: 4 bit 0111 becomes and 1011 becomes Step 2: Left shift A, Q by 1 bit. Step3: If M and A have the same signs, perform A=A-M otherwise A=A+M. Step 4: The Preceding operation is successful if the sign of A is the same before and after the operation. (a) If the operation is successful or A=0 then set Q0=1. (b) If the operation is unsuccessful and A!=0 then set Q0=0 and restore the previous value of A. Step 5: Repeat steps 2 to 4 as many times as there are bit positions in Q. Step 6: Remainder is in A. If the signs of the divisor and dividend were the same, then the quotient is in Q; otherwise the correct quotient is the two s complement of Q. CONCLUSION: The program to perform multiplication of two numbers using restoring Algorithm was performed and output obtained.

11 EXPERIMENT NO: 06 PROBLEM STATEMENT: Implementation of FIFO page replacement policy of virtual memory. THEORY: Regardless of the resident set management strategy, there are certain basic algorithms that are used for the selection of a page to replace in main memory. General page replacement algorithms include- First-in-first-out (FIFO) Least recently used (LRU) Optimal The first-in-first-out (FIFO) policy: It treats the page frames allocated to a process as a circular buffer, and pages are removed in round-robin style. All that is required is a pointer that circles through the page frames of the process. This is therefore one of the simplest page replacement policies to implement. The logic behind this choice, other than its simplicity, is that one is replacing the page that has been in memory the longest: A page fetched into memory a long time ago may have now fallen out of use. This reasoning will often be wrong, because there will often be regions of program or data that are heavily used throughout the life of a program. Those pages will be repeatedly paged in and out by the FIFO algorithm. In the below example, FIFO policy results in six page faults. Note that LRU recognizes that pages 2 and 5 are referenced more frequently than other pages, whereas FIFO does not. Example: ALGORITHM: FIFO First in first out 1. Accept frame size(fno), Number of pages(count) and sequence of pages(arr[100]) from user 2. Create circular linked list whose size is equal to frame size 3. Initialize each node s data = Call create function for CLL 5. When inserting data in a frame check whether a. Page number is already present or not b. There is empty location or not 6. If page is present then don t take any action, and read next page

12 7. But if page is not present then we have to insert page in LL 8. If Linked List have empty node then goto step 7 9. If Linked List doesn t have empty node then overwrite on the oldest node 10. stop CONCLUSION: We studied FIFO page replacement algorithm and implemented successfully.

13 EXPERIMENT NO: 07 PROBLEM STATEMENT: Implementation of LRU page replacement policy of virtual memory. THEORY: Regardless of the resident set management strategy, there are certain basic algorithms that are used for the selection of a page to replace in main memory. General page replacement algorithms include- First-in-first-out (FIFO) Least recently used (LRU) Optimal The least recently used (LRU) policy: It replaces the page in memory that has not been referenced for the longest time. By the principle of locality, this should be the page least likely to be referenced in the near future. And, in fact, the LRU policy does nearly as well as the optimal policy. The problem with this approach is the difficulty in implementation. One approach would be to tag each page with the time of its last reference; this would have to be done at each memory reference, both instruction and data. Even if the hardware would support such a scheme, the overhead would be tremendous. Alternatively, one could maintain a stack of page references, again an expensive prospect. Figure shows an example of the behavior of LRU, using the same page address stream as for the optimal policy example. In this example, there are four page faults. Example: ALGORITHM: LRU - Least Recently Used 1. Start 2. Declare the size of frame 3. Get the number of pages to be inserted 4. Get the sequence of pages 5. Declare counter and stack 6. Select the least recently used page by counter value 7. Stack them according the selection. 8. Display the values 9. Stop

14 CONCLUSION: We studied LRU page replacement algorithm and implemented successfully.

15 EXPERIMENT NO: 08 PROBLEM STATEMENT: Implementation of memory allocation algorithms. 1. First Fit 2. Best Fit 3. Worst Fit Theory: Memory compaction is time consuming; the operating system designer must be clever in deciding how to assign processes to memory (how to plug the holes). When it is time to load or swap a process into main memory, and if there is more than one free block of memory of sufficient size, then the operating system must decide which free block to allocate. Four placement algorithms that might be considered are best-fit, first-fit, worst-fit and next-fit. All are limited to choosing among free blocks of main memory that are equal to or larger than the process to be brought in. Best-fit chooses the block that is closest in size to the request. First-fit begins to scan memory from the beginning and chooses the first available block that is large enough. Next-fit begins to scan memory from the location of the last placement, and chooses the next available block that is large enough. Worst-fit chooses largest empty block of all. Figure (a) below shows an example memory configuration after a number of placement and swapping-out operations. The last block that was used was a 22-Mbyte block from which a 14- Mbyte partition was created. Best-fit will search the entire list of available blocks and make use of the 18-Mbyte block, leaving a 2-Mbyte fragment. First-fit results in a 6- Mbyte fragment, and next-fit results in a 20-Mbyte fragment. Which of these approaches is best will depend on the exact sequence of process swapping that occurs and the size of those processes. The first-fit algorithm is not only the simplest but usually the best and fastest as well. The next-fit algorithm tends to produce slightly worse results than the first-fit. The next-fit algorithm will more frequently lead to an allocation from a free block at the end of memory. The result is that the largest block of free memory, which usually appears at the end of the memory space, is quickly broken up into small fragments. Thus, compaction may be required more frequently with next-fit. On the other hand, the first-fit algorithm may litter the front end with small free partitions that need to be searched over on each subsequent first-fit pass. The best-fit algorithm, despite its name, is usually the worst performer. Because this algorithm looks for the smallest block that will satisfy the requirement, it guarantees that the fragment left behind is as small as possible. Although each memory request always wastes the smallest amount of memory, the result is that main memory is quickly littered by blocks too small to satisfy memory allocation requests. Thus, memory compaction must be done more frequently than with the other algorithms. Given memory partitions of 100K, 500K, 200K, 300K, and 600K (in order), how would each of the First-fit, Best-fit, and Worst-fit algorithms place processes of 212K, 417K, 112K, and 426K (in order)? Which algorithm makes the most efficient use of memory?

16 First-fit: 212K is put in 500K partition 417K is put in 600K partition 112K is put in 288K partition (new partition 288K = 500K - 212K) 426K must wait Best-fit: 212K is put in 300K partition 417K is put in 500K partition 112K is put in 200K partition 426K is put in 600K partition Worst-fit: 212K is put in 600K partition 417K is put in 500K partition 112K is put in 388K partition (600K 212K) 426K must wait In this example, Best-fit turns out to be the best. ALGORITHM: First Fit Algorithm 1. Start 2. Accept no. of partition(n) and size of each partition(s[i]) and no. of processes(p) and size of each process(sp[i]) from user. 3. Declare i, j, flag[10] 4. for(i=0;i<n;i++) 5. Initialize flag[i]=0 6. End of for loop 7. for(i=0; i<n; i++) 8. for(j=0;j<p;j++) 9. if( (s[i]>=sp[j]) && (flag[j]==0) ) then flag[j]=1; printf("\np%d",j); printf(" %d\t\t%d",sp[j],s[i]); break; 10. End of if 11. End of for loop 12. End of for loop 13. End Best Fit Algorithm:

17 1. Start 2. Accept no. of partition(n) and size of each partition(s[i]) and no. of processes(p) and size of each process(sp[i]) from user. 3. Declare i, j, flag[10], temp 4. for(i=0;i<n;i++) 5. for(j=i+1;j<n;j++) 6. if(s[i]>=s[j]) then temp=s[i] s[i]=s[j] s[j]=temp 7. End of if 8. End of for 9. End of for 10. for(i=0;i<n;i++) 11. flag[i]=0 12. for(i=0;i<n;i++) 13. for(j=0;j<p;j++) 14. if( (s[i]>=sp[j]) && (flag[j]==0) ) then flag[j]=1; printf("\np%d",j); printf(" %d\t\t%d",sp[j],s[i]); break; 15. End of if 16. End of for 17. end of for 18. end Worst Fit algorithm 1. Start 2. Accept no. of partition(n) and size of each partition(s[i]) and no. of processes(p) and size of each process(sp[i]) from user. 3. Declare i, j, flag[10], temp 4. for(i=0;i<n;i++) 5. for(j=i+1;j<n;j++) 6. if(s[i]<=s[j]) then temp=s[i]; s[i]=s[j]; s[j]=temp 7. End of if 8. End of for 9. End of for 10. End CONCLUSION: Implementation of memory allocation algorithms performed successfully and obtained output.

18 EXPERIMENT NO: 09 PROBLEM STATEMENT: To Study and implementation of Data Hazards THEORY: In the domain of central processing unit (CPU) design, hazards are problems with the instruction pipeline in CPU micro architectures when the next instruction cannot execute in the following clock cycle, [1] and can potentially lead to incorrect computation results. There are typically three types of hazards: data hazards structural hazards control hazards (branching hazards) Data hazards Data hazards occur when instructions that exhibit data dependence modify data in different stages of a pipeline. Ignoring potential data hazards can result in race conditions (sometimes known as race hazards). The use of the result of the SUB instruction in the next three instructions causes a data hazard, since the register $2 is not written until after those instructions read it. There are three situations in which a data hazard can occur: 1. read after write (RAW), a true dependency 2. write after read (WAR), an anti-dependency 3. write after write (WAW), an output dependency Consider two instructions i1 and i2, with i1 occurring before i2 in program order.

19 1. Read After Write (RAW) A read after write (RAW) data hazard refers to a situation where an instruction refers to a result that has not yet been calculated or retrieved. This can occur because even though an instruction is executed after a previous instruction, the previous instruction has not been completely processed through the pipeline. (i2 tries to read a source before i1 writes to it) Example i1. R2 <- R1 + R3 i2. R4 <- R2 + R3 The first instruction is calculating a value to be saved in register R2, and the second is going to use this value to compute a result for register R4. However, in a pipeline, when we fetch the operands for the 2nd operation, the results from the first will not yet have been saved, and hence we have a data dependency.we say that there is a data dependency with instruction i2, as it is dependent on the completion of instruction i1. 2. Write After Read (WAR) A write after read (WAR) data hazard represents a problem with concurrent execution. (i2 tries to write a destination before it is read by i1). Example i1. R4 <- R1 + R5 i2. R5 <- R1 + R2 If we are in a situation that there is a chance that i2 may be completed before i1 (i.e. with concurrent execution) we must ensure that we do not store the result of register R5before i1 has had a chance to fetch the operands. 3. Write After Write (WAW) A write after write (WAW) data hazard may occur in a concurrent execution environment. (i2 tries to write an operand before it is written by i1) Example i1. R2 <- R4 + R7 i2. R2 <- R1 + R3 We must delay the WB (Write Back) of i2 until the execution of i1. 4. Structural hazards A structural hazard occurs when a part of the processor's hardware is needed by two or more instructions at the same time. A canonical example is a single memory unit that is accessed both in the fetch stage where an instruction is retrieved from memory, and the memory stage where data is written and/or read from memory..

20 5. Control hazards (branch hazards) Branching hazards (also known as control hazards) occur with branches. On many instruction pipeline micro architectures, the processor will not know the outcome of the branch when it needs to insert a new instruction into the pipeline. CONCLUSION: We studied and implemented data hazards successfully.

21 EXPERIMENT No: 10 PROBLEM STATEMENT: Procedure for execute the Assembly program using TASM THEORY: 1. Assembly language programs are converted into executable machine code by a utility program referred to as an assembler, the conversion process being referred to as assembly or assembling the program. 2. Assembly language (sometimes abbreviated as ASM, usually as the file extension for a text file which is used as a code for a program written in Assembly language, or in the names of assemblers, like FASM, MASM, NASM and TASM) is a low level programming language for computers, microprocessors, microcontrollers, and other programmable devices in which each statement corresponds to a single machine language instruction. An assembly language is specific to a certain computer architecture, in contrast to most high level programming languages, which generally are portable to multiple systems. What is TASM assembler? The Turbo Assembler (TASM) is an x86 assembler that uses the Intel syntax for MS DOS and Microsoft Windows. Beginning with TASM 8.0 there are two versions of the assembler one for 16 bit and 32 bit assembly sources, and another (ML64) for 64 bit sources only. Assembling and Running Assembly Language Programs An assembly language program must be assembled and linked before it can be executed. The assembler produces an object file (extension.obj). This file is taken by the linker and an executable program (extension.exe) is produced, assuming there were no errors in the program. We use the MASM assembler and the LINK linker. These are available on NAL under Programming: TASM filesv 5.0. When saving the file with Notepad, you MUST save it with the File Type set to All Files. You should now select the MS DOS Prompt (Command PROMPT) from the Start button menu (sometimes under Programs option) Following are steps to execute a assembly program in tasm assembler. 1. Save.asm extention file by writing code in text editor. 2. Open dos prompt 3. Go the target file by prompt 4. Write tasm filename.asm and press enter 5. Write tlink filename.obj and press enter

22 6. Write debug filename.exe and press enter 7. Cursor will be displayed. Press t for single step debugging mode otherwise g for direct compilation. Tasm folder must contains 1. Tasm exe 2. Tlink exe 3. Td.exe Following are steps to execute a mixed language program in TURBOC. 1. Write a program in turbo c editor and save it as.cpp file 2. Go the compile 3. Run the compile file Note: GUI based Emulator 8085/ 8086 can also be used to write and execute assembly programs. In the event of errors, you must edit your program and correct the errors. Then you repeat the above steps to assemble and link your program, before running it. Similarly, if you modify your program, you must assemble and link it before running it again. CONCLUSION: We studied the working of TASM software. We also executed some basic programs on TASM successfully.

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

ECOM 2325 Computer Organization and Assembly Language. Instructor: Ruba A.Salamah INTRODUCTION ECOM 2325 Computer Organization and Assembly Language Instructor: Ruba A.Salamah INTRODUCTION Overview Welcome to ECOM 2325 Assembly-, Machine-, and High-Level Languages Assembly Language Programming Tools

More information

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR UNIT I Digital Systems: Binary Numbers, Octal, Hexa Decimal and other base numbers, Number base conversions, complements, signed binary numbers, Floating point number representation, binary codes, error

More information

Computer Organization and Assembly Language. Lab Session 01

Computer Organization and Assembly Language. Lab Session 01 Objective: Lab Session 01 Introduction to Assembly Language Tools and Familiarization with Emu8086 environment To be able to understand Data Representation and perform conversions from one system to another

More information

a process may be swapped in and out of main memory such that it occupies different regions

a process may be swapped in and out of main memory such that it occupies different regions Virtual Memory Characteristics of Paging and Segmentation A process may be broken up into pieces (pages or segments) that do not need to be located contiguously in main memory Memory references are dynamically

More information

COMPUTER ARCHITECTURE AND ORGANIZATION. Operation Add Magnitudes Subtract Magnitudes (+A) + ( B) + (A B) (B A) + (A B)

COMPUTER ARCHITECTURE AND ORGANIZATION. Operation Add Magnitudes Subtract Magnitudes (+A) + ( B) + (A B) (B A) + (A B) Computer Arithmetic Data is manipulated by using the arithmetic instructions in digital computers. Data is manipulated to produce results necessary to give solution for the computation problems. The Addition,

More information

COMPUTER ARITHMETIC (Part 1)

COMPUTER ARITHMETIC (Part 1) Eastern Mediterranean University School of Computing and Technology ITEC255 Computer Organization & Architecture COMPUTER ARITHMETIC (Part 1) Introduction The two principal concerns for computer arithmetic

More information

COMP 346 WINTER 2018 MEMORY MANAGEMENT (VIRTUAL MEMORY)

COMP 346 WINTER 2018 MEMORY MANAGEMENT (VIRTUAL MEMORY) COMP 346 WINTER 2018 1 MEMORY MANAGEMENT (VIRTUAL MEMORY) VIRTUAL MEMORY A process may be broken up into pieces (pages or segments) that do not need to be located contiguously in main memory. Memory references

More information

Chapter 10 - Computer Arithmetic

Chapter 10 - Computer Arithmetic Chapter 10 - Computer Arithmetic Luis Tarrataca luis.tarrataca@gmail.com CEFET-RJ L. Tarrataca Chapter 10 - Computer Arithmetic 1 / 126 1 Motivation 2 Arithmetic and Logic Unit 3 Integer representation

More information

Chapter Overview. Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 1: Basic Concepts. Printing this Slide Show

Chapter Overview. Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 1: Basic Concepts. Printing this Slide Show Assembly Language for Intel-Based Computers, 4 th Edition Kip R. Irvine Chapter 1: Basic Concepts Chapter Overview Welcome to Assembly Language Virtual Machine Concept Data Representation Boolean Operations

More information

Number representations

Number representations Number representations Number bases Three number bases are of interest: Binary, Octal and Hexadecimal. We look briefly at conversions among them and between each of them and decimal. Binary Base-two, or

More information

Chapter 5 : Computer Arithmetic

Chapter 5 : Computer Arithmetic Chapter 5 Computer Arithmetic Integer Representation: (Fixedpoint representation): An eight bit word can be represented the numbers from zero to 255 including = 1 = 1 11111111 = 255 In general if an nbit

More information

Course Syllabus [1/2]

Course Syllabus [1/2] Course Syllabus [1/2] Instructor 逄愛君, acpang@csie.ntu.edu.tw Office Number: 417, Office Hour: 15:00~17:00 (Thursday) Textbook Assembly Language for Intel-Based Computers, Kip R. Irvine, Pearson Education,

More information

General Objective:To understand the basic memory management of operating system. Specific Objectives: At the end of the unit you should be able to:

General Objective:To understand the basic memory management of operating system. Specific Objectives: At the end of the unit you should be able to: F2007/Unit6/1 UNIT 6 OBJECTIVES General Objective:To understand the basic memory management of operating system Specific Objectives: At the end of the unit you should be able to: define the memory management

More information

carry in carry 1101 carry carry

carry in carry 1101 carry carry Chapter Binary arithmetic Arithmetic is the process of applying a mathematical operator (such as negation or addition) to one or more operands (the values being operated upon). Binary arithmetic works

More information

Module 2: Computer Arithmetic

Module 2: Computer Arithmetic Module 2: Computer Arithmetic 1 B O O K : C O M P U T E R O R G A N I Z A T I O N A N D D E S I G N, 3 E D, D A V I D L. P A T T E R S O N A N D J O H N L. H A N N E S S Y, M O R G A N K A U F M A N N

More information

(+A) + ( B) + (A B) (B A) + (A B) ( A) + (+ B) (A B) + (B A) + (A B) (+ A) (+ B) + (A - B) (B A) + (A B) ( A) ( B) (A B) + (B A) + (A B)

(+A) + ( B) + (A B) (B A) + (A B) ( A) + (+ B) (A B) + (B A) + (A B) (+ A) (+ B) + (A - B) (B A) + (A B) ( A) ( B) (A B) + (B A) + (A B) COMPUTER ARITHMETIC 1. Addition and Subtraction of Unsigned Numbers The direct method of subtraction taught in elementary schools uses the borrowconcept. In this method we borrow a 1 from a higher significant

More information

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

UNIT-II. Part-2: CENTRAL PROCESSING UNIT Page1 UNIT-II Part-2: CENTRAL PROCESSING UNIT Stack Organization Instruction Formats Addressing Modes Data Transfer And Manipulation Program Control Reduced Instruction Set Computer (RISC) Introduction:

More information

Computer Organisation CS303

Computer Organisation CS303 Computer Organisation CS303 Module Period Assignments 1 Day 1 to Day 6 1. Write a program to evaluate the arithmetic statement: X=(A-B + C * (D * E-F))/G + H*K a. Using a general register computer with

More information

COMPUTER ORGANIZATION AND ARCHITECTURE

COMPUTER ORGANIZATION AND ARCHITECTURE COMPUTER ORGANIZATION AND ARCHITECTURE For COMPUTER SCIENCE COMPUTER ORGANIZATION. SYLLABUS AND ARCHITECTURE Machine instructions and addressing modes, ALU and data-path, CPU control design, Memory interface,

More information

Lecture 8: Addition, Multiplication & Division

Lecture 8: Addition, Multiplication & Division Lecture 8: Addition, Multiplication & Division Today s topics: Signed/Unsigned Addition Multiplication Division 1 Signed / Unsigned The hardware recognizes two formats: unsigned (corresponding to the C

More information

Role of OS in virtual memory management

Role of OS in virtual memory management Role of OS in virtual memory management Role of OS memory management Design of memory-management portion of OS depends on 3 fundamental areas of choice Whether to use virtual memory or not Whether to use

More information

CHW 261: Logic Design

CHW 261: Logic Design CHW 261: Logic Design Instructors: Prof. Hala Zayed Dr. Ahmed Shalaby http://www.bu.edu.eg/staff/halazayed14 http://bu.edu.eg/staff/ahmedshalaby14# Slide 1 Slide 2 Slide 3 Digital Fundamentals CHAPTER

More information

Memory Management. Reading: Silberschatz chapter 9 Reading: Stallings. chapter 7 EEL 358

Memory Management. Reading: Silberschatz chapter 9 Reading: Stallings. chapter 7 EEL 358 Memory Management Reading: Silberschatz chapter 9 Reading: Stallings chapter 7 1 Outline Background Issues in Memory Management Logical Vs Physical address, MMU Dynamic Loading Memory Partitioning Placement

More information

9 Multiplication and Division

9 Multiplication and Division 9 Multiplication and Division Multiplication is done by doing shifts and additions. Multiplying two (unsigned) numbers of n bits each results in a product of 2n bits. Example: 0110 x 0011 (6x3) At start,

More information

VARDHAMAN COLLEGE OF ENGINEERING (AUTONOMOUS) Shamshabad, Hyderabad

VARDHAMAN COLLEGE OF ENGINEERING (AUTONOMOUS) Shamshabad, Hyderabad Introduction to MS-DOS Debugger DEBUG In this laboratory, we will use DEBUG program and learn how to: 1. Examine and modify the contents of the 8086 s internal registers, and dedicated parts of the memory

More information

Chapter 2. Data Representation in Computer Systems

Chapter 2. Data Representation in Computer Systems Chapter 2 Data Representation in Computer Systems Chapter 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers. Master the skill of converting

More information

Number Systems and Computer Arithmetic

Number Systems and Computer Arithmetic Number Systems and Computer Arithmetic Counting to four billion two fingers at a time What do all those bits mean now? bits (011011011100010...01) instruction R-format I-format... integer data number text

More information

NUMBER SCALING FOR THE LGP-27

NUMBER SCALING FOR THE LGP-27 NUMBER SCALING FOR THE LGP-27 5 SCALING The LGP-21 considers all numbers to be within the range -l

More information

Lecture 7. Memory Management

Lecture 7. Memory Management Lecture 7 Memory Management 1 Lecture Contents 1. Memory Management Requirements 2. Memory Partitioning 3. Paging 4. Segmentation 2 Memory Memory is an array of words or bytes, each with its own address.

More information

Addresses in the source program are generally symbolic. A compiler will typically bind these symbolic addresses to re-locatable addresses.

Addresses in the source program are generally symbolic. A compiler will typically bind these symbolic addresses to re-locatable addresses. 1 Memory Management Address Binding The normal procedures is to select one of the processes in the input queue and to load that process into memory. As the process executed, it accesses instructions and

More information

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS (09 periods) Computer Arithmetic: Data Representation, Fixed Point Representation, Floating Point Representation, Addition and

More information

The x86 Microprocessors. Introduction. The 80x86 Microprocessors. 1.1 Assembly Language

The x86 Microprocessors. Introduction. The 80x86 Microprocessors. 1.1 Assembly Language The x86 Microprocessors Introduction 1.1 Assembly Language Numbering and Coding Systems Human beings use the decimal system (base 10) Decimal digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Computer systems use the

More information

Number Systems CHAPTER Positional Number Systems

Number Systems CHAPTER Positional Number Systems CHAPTER 2 Number Systems Inside computers, information is encoded as patterns of bits because it is easy to construct electronic circuits that exhibit the two alternative states, 0 and 1. The meaning of

More information

Memory Management. 3. What two registers can be used to provide a simple form of memory protection? Base register Limit Register

Memory Management. 3. What two registers can be used to provide a simple form of memory protection? Base register Limit Register Memory Management 1. Describe the sequence of instruction-execution life cycle? A typical instruction-execution life cycle: Fetches (load) an instruction from specific memory address. Decode the instruction

More information

Math in MIPS. Subtracting a binary number from another binary number also bears an uncanny resemblance to the way it s done in decimal.

Math in MIPS. Subtracting a binary number from another binary number also bears an uncanny resemblance to the way it s done in decimal. Page < 1 > Math in MIPS Adding and Subtracting Numbers Adding two binary numbers together is very similar to the method used with decimal numbers, except simpler. When you add two binary numbers together,

More information

PESIT Bangalore South Campus

PESIT Bangalore South Campus INTERNAL ASSESSMENT TEST III Date : 21/11/2017 Max Marks : 40 Subject & Code : Computer Organization (15CS34) Semester : III (A & B) Name of the faculty: Mrs. Sharmila Banu Time : 11.30 am 1.00 pm Answer

More information

PART A (22 Marks) 2. a) Briefly write about r's complement and (r-1)'s complement. [8] b) Explain any two ways of adding decimal numbers.

PART A (22 Marks) 2. a) Briefly write about r's complement and (r-1)'s complement. [8] b) Explain any two ways of adding decimal numbers. Set No. 1 IV B.Tech I Semester Supplementary Examinations, March - 2017 COMPUTER ARCHITECTURE & ORGANIZATION (Common to Electronics & Communication Engineering and Electronics & Time: 3 hours Max. Marks:

More information

Level ISA3: Information Representation

Level ISA3: Information Representation Level ISA3: Information Representation 1 Information as electrical current At the lowest level, each storage unit in a computer s memory is equipped to contain either a high or low voltage signal Each

More information

COMP 303 Computer Architecture Lecture 6

COMP 303 Computer Architecture Lecture 6 COMP 303 Computer Architecture Lecture 6 MULTIPLY (unsigned) Paper and pencil example (unsigned): Multiplicand 1000 = 8 Multiplier x 1001 = 9 1000 0000 0000 1000 Product 01001000 = 72 n bits x n bits =

More information

CS399 New Beginnings. Jonathan Walpole

CS399 New Beginnings. Jonathan Walpole CS399 New Beginnings Jonathan Walpole Memory Management Memory Management Memory a linear array of bytes - Holds O.S. and programs (processes) - Each cell (byte) is named by a unique memory address Recall,

More information

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010 Contents Number systems and conversion Binary arithmetic Representation of negative numbers Addition of two s complement numbers Addition of one s complement numbers Binary s Readings Unit.~. UNIT NUMBER

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2017 Lecture 23 Virtual memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ Is a page replaces when

More information

Chapter 5: Computer Arithmetic. In this chapter you will learn about:

Chapter 5: Computer Arithmetic. In this chapter you will learn about: Slide 1/29 Learning Objectives In this chapter you will learn about: Reasons for using binary instead of decimal numbers Basic arithmetic operations using binary numbers Addition (+) Subtraction (-) Multiplication

More information

Chapter 8 Virtual Memory

Chapter 8 Virtual Memory Operating Systems: Internals and Design Principles Chapter 8 Virtual Memory Seventh Edition William Stallings Modified by Rana Forsati for CSE 410 Outline Principle of locality Paging - Effect of page

More information

Number Systems and Binary Arithmetic. Quantitative Analysis II Professor Bob Orr

Number Systems and Binary Arithmetic. Quantitative Analysis II Professor Bob Orr Number Systems and Binary Arithmetic Quantitative Analysis II Professor Bob Orr Introduction to Numbering Systems We are all familiar with the decimal number system (Base 10). Some other number systems

More information

Learning Objectives. Binary over Decimal. In this chapter you will learn about:

Learning Objectives. Binary over Decimal. In this chapter you will learn about: Ref Page Slide 1/29 Learning Objectives In this chapter you will learn about: Reasons for using binary instead of decimal numbers Basic arithmetic operations using binary numbers Addition (+) Subtraction

More information

CPE300: Digital System Architecture and Design

CPE300: Digital System Architecture and Design CPE300: Digital System Architecture and Design Fall 2011 MW 17:30-18:45 CBC C316 Arithmetic Unit 10122011 http://www.egr.unlv.edu/~b1morris/cpe300/ 2 Outline Recap Fixed Point Arithmetic Addition/Subtraction

More information

Floating Point Arithmetic

Floating Point Arithmetic Floating Point Arithmetic Floating point numbers are frequently used in many applications. Implementation of arithmetic units such as adder, multiplier, etc for Floating point numbers are more complex

More information

Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar

Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar Data Representation COE 30 Computer Organization Prof. Muhamed Mudawar College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals Presentation Outline Positional Number

More information

Number System. Introduction. Decimal Numbers

Number System. Introduction. Decimal Numbers Number System Introduction Number systems provide the basis for all operations in information processing systems. In a number system the information is divided into a group of symbols; for example, 26

More information

The ALU consists of combinational logic. Processes all data in the CPU. ALL von Neuman machines have an ALU loop.

The ALU consists of combinational logic. Processes all data in the CPU. ALL von Neuman machines have an ALU loop. CS 320 Ch 10 Computer Arithmetic The ALU consists of combinational logic. Processes all data in the CPU. ALL von Neuman machines have an ALU loop. Signed integers are typically represented in sign-magnitude

More information

Arithmetic Processing

Arithmetic Processing CS/EE 5830/6830 VLSI ARCHITECTURE Chapter 1 Basic Number Representations and Arithmetic Algorithms Arithmetic Processing AP = (operands, operation, results, conditions, singularities) Operands are: Set

More information

COE 202- Digital Logic. Number Systems II. Dr. Abdulaziz Y. Barnawi COE Department KFUPM. January 23, Abdulaziz Barnawi. COE 202 Logic Design

COE 202- Digital Logic. Number Systems II. Dr. Abdulaziz Y. Barnawi COE Department KFUPM. January 23, Abdulaziz Barnawi. COE 202 Logic Design 1 COE 0- Digital Logic Number Systems II Dr. Abdulaziz Y. Barnawi COE Department KFUPM COE 0 Logic Design January 3, 016 Objectives Base Conversion Decimal to other bases Binary to Octal and Hexadecimal

More information

MEMORY MANAGEMENT/1 CS 409, FALL 2013

MEMORY MANAGEMENT/1 CS 409, FALL 2013 MEMORY MANAGEMENT Requirements: Relocation (to different memory areas) Protection (run time, usually implemented together with relocation) Sharing (and also protection) Logical organization Physical organization

More information

BINARY SYSTEM. Binary system is used in digital systems because it is:

BINARY SYSTEM. Binary system is used in digital systems because it is: CHAPTER 2 CHAPTER CONTENTS 2.1 Binary System 2.2 Binary Arithmetic Operation 2.3 Signed & Unsigned Numbers 2.4 Arithmetic Operations of Signed Numbers 2.5 Hexadecimal Number System 2.6 Octal Number System

More information

Internal Data Representation

Internal Data Representation Appendices This part consists of seven appendices, which provide a wealth of reference material. Appendix A primarily discusses the number systems and their internal representation. Appendix B gives information

More information

ECE519 Advanced Operating Systems

ECE519 Advanced Operating Systems IT 540 Operating Systems ECE519 Advanced Operating Systems Prof. Dr. Hasan Hüseyin BALIK (8 th Week) (Advanced) Operating Systems 8. Virtual Memory 8. Outline Hardware and Control Structures Operating

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Spring 2018 L20 Virtual Memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 Questions from last time Page

More information

At the ith stage: Input: ci is the carry-in Output: si is the sum ci+1 carry-out to (i+1)st state

At the ith stage: Input: ci is the carry-in Output: si is the sum ci+1 carry-out to (i+1)st state Chapter 4 xi yi Carry in ci Sum s i Carry out c i+ At the ith stage: Input: ci is the carry-in Output: si is the sum ci+ carry-out to (i+)st state si = xi yi ci + xi yi ci + xi yi ci + xi yi ci = x i yi

More information

Process size is independent of the main memory present in the system.

Process size is independent of the main memory present in the system. Hardware control structure Two characteristics are key to paging and segmentation: 1. All memory references are logical addresses within a process which are dynamically converted into physical at run time.

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2016 Lecture 33 Virtual Memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ How does the virtual

More information

CS Computer Architecture

CS Computer Architecture CS 35101 Computer Architecture Section 600 Dr. Angela Guercio Fall 2010 An Example Implementation In principle, we could describe the control store in binary, 36 bits per word. We will use a simple symbolic

More information

19 Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd

19 Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd 19 Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd Will you walk a little faster? said a whiting to a snail, There s a porpoise close behind us, and he s treading

More information

Arithmetic Operations

Arithmetic Operations Arithmetic Operations Arithmetic Operations addition subtraction multiplication division Each of these operations on the integer representations: unsigned two's complement 1 Addition One bit of binary

More information

Chapter 8 Virtual Memory

Chapter 8 Virtual Memory Operating Systems: Internals and Design Principles Chapter 8 Virtual Memory Seventh Edition William Stallings Operating Systems: Internals and Design Principles You re gonna need a bigger boat. Steven

More information

DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) COURSE / CODE NUMBER SYSTEM

DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) COURSE / CODE NUMBER SYSTEM COURSE / CODE DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) NUMBER SYSTEM A considerable subset of digital systems deals with arithmetic operations. To understand the

More information

Lesson 1: THE DECIMAL SYSTEM

Lesson 1: THE DECIMAL SYSTEM Lesson 1: THE DECIMAL SYSTEM The word DECIMAL comes from a Latin word, which means "ten. The Decimal system uses the following ten digits to write a number: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Each time

More information

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

D I G I T A L C I R C U I T S E E D I G I T A L C I R C U I T S E E Digital Circuits Basic Scope and Introduction This book covers theory solved examples and previous year gate question for following topics: Number system, Boolean algebra,

More information

Computer Arithmetic Ch 8

Computer Arithmetic Ch 8 Computer Arithmetic Ch 8 ALU Integer Representation Integer Arithmetic Floating-Point Representation Floating-Point Arithmetic 1 Arithmetic Logical Unit (ALU) (2) (aritmeettis-looginen yksikkö) Does all

More information

UNIT-III COMPUTER ARTHIMETIC

UNIT-III COMPUTER ARTHIMETIC UNIT-III COMPUTER ARTHIMETIC INTRODUCTION Arithmetic Instructions in digital computers manipulate data to produce results necessary for the of activity solution of computational problems. These instructions

More information

Virtual Memory. Chapter 8

Virtual Memory. Chapter 8 Virtual Memory 1 Chapter 8 Characteristics of Paging and Segmentation Memory references are dynamically translated into physical addresses at run time E.g., process may be swapped in and out of main memory

More information

1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM

1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM 1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM 1.1 Introduction Given that digital logic and memory devices are based on two electrical states (on and off), it is natural to use a number

More information

Computer Arithmetic Ch 8

Computer Arithmetic Ch 8 Computer Arithmetic Ch 8 ALU Integer Representation Integer Arithmetic Floating-Point Representation Floating-Point Arithmetic 1 Arithmetic Logical Unit (ALU) (2) Does all work in CPU (aritmeettis-looginen

More information

Chapter 5: Computer Arithmetic

Chapter 5: Computer Arithmetic Slide 1/29 Learning Objectives Computer Fundamentals: Pradeep K. Sinha & Priti Sinha In this chapter you will learn about: Reasons for using binary instead of decimal numbers Basic arithmetic operations

More information

COMP Overview of Tutorial #2

COMP Overview of Tutorial #2 COMP 1402 Winter 2008 Tutorial #2 Overview of Tutorial #2 Number representation basics Binary conversions Octal conversions Hexadecimal conversions Signed numbers (signed magnitude, one s and two s complement,

More information

Chapter 8 & Chapter 9 Main Memory & Virtual Memory

Chapter 8 & Chapter 9 Main Memory & Virtual Memory Chapter 8 & Chapter 9 Main Memory & Virtual Memory 1. Various ways of organizing memory hardware. 2. Memory-management techniques: 1. Paging 2. Segmentation. Introduction Memory consists of a large array

More information

Microcontroller Systems

Microcontroller Systems µcontroller systems 1 / 43 Microcontroller Systems Engineering Science 2nd year A2 Lectures Prof David Murray david.murray@eng.ox.ac.uk www.robots.ox.ac.uk/ dwm/courses/2co Michaelmas 2014 µcontroller

More information

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 CS 64 Lecture 2 Data Representation Reading: FLD 1.2-1.4 Decimal Numbers: Base 10 Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Example: 3271 = (3x10 3 ) + (2x10 2 ) + (7x10 1 ) + (1x10 0 ) 1010 10?= 1010 2?= 1

More information

Chapter 7 Memory Management

Chapter 7 Memory Management Operating Systems: Internals and Design Principles Chapter 7 Memory Management Ninth Edition William Stallings Frame Page Segment A fixed-length block of main memory. A fixed-length block of data that

More information

Floating-Point Data Representation and Manipulation 198:231 Introduction to Computer Organization Lecture 3

Floating-Point Data Representation and Manipulation 198:231 Introduction to Computer Organization Lecture 3 Floating-Point Data Representation and Manipulation 198:231 Introduction to Computer Organization Instructor: Nicole Hynes nicole.hynes@rutgers.edu 1 Fixed Point Numbers Fixed point number: integer part

More information

in this web service Cambridge University Press

in this web service Cambridge University Press 978-0-51-85748- - Switching and Finite Automata Theory, Third Edition Part 1 Preliminaries 978-0-51-85748- - Switching and Finite Automata Theory, Third Edition CHAPTER 1 Number systems and codes This

More information

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

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 1: Basic Concepts. Chapter Overview. Welcome to Assembly Language Assembly Language for Intel-Based Computers, 4 th Edition Kip R. Irvine Chapter 1: Basic Concepts Slides prepared by Kip R. Irvine Revision date: 09/15/2002 Chapter corrections (Web) Printing a slide show

More information

Special Section: Building Your Own Compiler

Special Section: Building Your Own Compiler cshtp6_19_datastructures_compiler.fm Page 1 Tuesday, February 14, 2017 10:31 AM 1 Chapter 19 Special Section: Building Your Own Compiler In Exercises8.31 8.33, we introduced Simpletron Machine Language

More information

Memory management. Knut Omang Ifi/Oracle 10 Oct, 2012

Memory management. Knut Omang Ifi/Oracle 10 Oct, 2012 Memory management Knut Omang Ifi/Oracle 1 Oct, 212 (with slides from V. Goebel, C. Griwodz (Ifi/UiO), P. Halvorsen (Ifi/UiO), K. Li (Princeton), A. Tanenbaum (VU Amsterdam), and M. van Steen (VU Amsterdam))

More information

Structure of Computer Systems

Structure of Computer Systems 288 between this new matrix and the initial collision matrix M A, because the original forbidden latencies for functional unit A still have to be considered in later initiations. Figure 5.37. State diagram

More information

Memory Management. Memory Management. G53OPS: Operating Systems. Memory Management Monoprogramming 11/27/2008. Graham Kendall.

Memory Management. Memory Management. G53OPS: Operating Systems. Memory Management Monoprogramming 11/27/2008. Graham Kendall. Memory Management Memory Management Introduction Graham Kendall Memory Management consists of many tasks, including Being aware of what parts of the memory are in use and which parts are not Allocating

More information

DC57 COMPUTER ORGANIZATION JUNE 2013

DC57 COMPUTER ORGANIZATION JUNE 2013 Q2 (a) How do various factors like Hardware design, Instruction set, Compiler related to the performance of a computer? The most important measure of a computer is how quickly it can execute programs.

More information

Chapter 3 Arithmetic for Computers (Part 2)

Chapter 3 Arithmetic for Computers (Part 2) Department of Electr rical Eng ineering, Chapter 3 Arithmetic for Computers (Part 2) 王振傑 (Chen-Chieh Wang) ccwang@mail.ee.ncku.edu.tw ncku edu Depar rtment of Electr rical Eng ineering, Feng-Chia Unive

More information

Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997

Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997 Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997 APPENDIX A.1 Number systems and codes Since ten-fingered humans are addicted to the decimal system, and since computers

More information

World Inside a Computer is Binary

World Inside a Computer is Binary C Programming 1 Representation of int data World Inside a Computer is Binary C Programming 2 Decimal Number System Basic symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Radix-10 positional number system. The radix

More information

Kinds Of Data CHAPTER 3 DATA REPRESENTATION. Numbers Are Different! Positional Number Systems. Text. Numbers. Other

Kinds Of Data CHAPTER 3 DATA REPRESENTATION. Numbers Are Different! Positional Number Systems. Text. Numbers. Other Kinds Of Data CHAPTER 3 DATA REPRESENTATION Numbers Integers Unsigned Signed Reals Fixed-Point Floating-Point Binary-Coded Decimal Text ASCII Characters Strings Other Graphics Images Video Audio Numbers

More information

Arithmetic Logic Unit

Arithmetic Logic Unit Arithmetic Logic Unit A.R. Hurson Department of Computer Science Missouri University of Science & Technology A.R. Hurson 1 Arithmetic Logic Unit It is a functional bo designed to perform "basic" arithmetic,

More information

Virtual Memory Outline

Virtual Memory Outline Virtual Memory Outline Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations Operating-System Examples

More information

Operating Systems and Computer Networks. Memory Management. Dr.-Ing. Pascal A. Klein

Operating Systems and Computer Networks. Memory Management. Dr.-Ing. Pascal A. Klein Operating Systems and Computer Networks Memory Management pascal.klein@uni-due.de Alexander Maxeiner, M.Sc. Faculty of Engineering Agenda 1 Swapping 2 Segmentation Algorithms 3 Memory Allocation 4 Virtual

More information

COE 202: Digital Logic Design Number Systems Part 2. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

COE 202: Digital Logic Design Number Systems Part 2. Dr. Ahmad Almulhem   ahmadsm AT kfupm Phone: Office: COE 0: Digital Logic Design Number Systems Part Dr. Ahmad Almulhem Email: ahmadsm AT kfupm Phone: 860-7554 Office: -34 Objectives Arithmetic operations: Binary number system Other number systems Base Conversion

More information

Number Systems. Both numbers are positive

Number Systems. Both numbers are positive Number Systems Range of Numbers and Overflow When arithmetic operation such as Addition, Subtraction, Multiplication and Division are performed on numbers the results generated may exceed the range of

More information

CS321. Introduction to Numerical Methods

CS321. Introduction to Numerical Methods CS31 Introduction to Numerical Methods Lecture 1 Number Representations and Errors Professor Jun Zhang Department of Computer Science University of Kentucky Lexington, KY 40506 0633 August 5, 017 Number

More information

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Introduction to Computing Module No: CS/ES/1 Quadrant 1 e-text

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Introduction to Computing Module No: CS/ES/1 Quadrant 1 e-text e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Introduction to Computing Module No: CS/ES/1 Quadrant 1 e-text About the course : In this digital world, embedded systems are more

More information

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Dec Hex Bin ORG ; ZERO. Introduction To Computing Dec Hex Bin 0 0 00000000 ORG ; ZERO Introduction To Computing OBJECTIVES this chapter enables the student to: Convert any number from base 2, base 10, or base 16 to any of the other two bases. Add and

More information

Memory Management Virtual Memory

Memory Management Virtual Memory Memory Management Virtual Memory Part of A3 course (by Theo Schouten) Biniam Gebremichael http://www.cs.ru.nl/~biniam/ Office: A6004 April 4 2005 Content Virtual memory Definition Advantage and challenges

More information