Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 COMPUTER ARCHITECTURE (LECTURE) By Baljinder Singh Assistant Professor (CSE/IT) Beant College of Engg. & Technology, Gurdaspur.

Similar presentations


Presentation on theme: "1 COMPUTER ARCHITECTURE (LECTURE) By Baljinder Singh Assistant Professor (CSE/IT) Beant College of Engg. & Technology, Gurdaspur."— Presentation transcript:

1 1 COMPUTER ARCHITECTURE (LECTURE) By Baljinder Singh Assistant Professor (CSE/IT) Beant College of Engg. & Technology, Gurdaspur

2 2 CONTENTS Principles of computer design. Software hardware interaction. Cost benefit concept of layers in architecture design. Introduction to 8085. Number System. Binary Arithmetic. Carry look ahead adder.

3 3 Digital Computer Digital Computer:- The digital computer is a digital system that performs various computational tasks. The digital means that having two discrete values i.e 0 & 1, HIGH & LOW, TRUE& FALSE, ON & OFF. Digital Computer:- The digital computer is a digital system that performs various computational tasks. The digital means that having two discrete values i.e 0 & 1, HIGH & LOW, TRUE& FALSE, ON & OFF. so digital computer uses the binary no. system, which has two digits: 0 and 1. so digital computer uses the binary no. system, which has two digits: 0 and 1. 0 1 Bit 1 Bit So information is represented in digital computers in groups of bits. To represents various letters, digits & special symbol we use various coding schemes. So information is represented in digital computers in groups of bits. To represents various letters, digits & special symbol we use various coding schemes.

4 4 Digital Signal

5 5 Basics Computer Organization

6 6 Conttd… A computer system is subdivided into two functional entities: 1. Hardware 2. Software The H/W of the computer consists of all the electronics components and electromechanical devices. Computer S/W consists of the instructions and data that the computer manipulates to perform various data processing tasks. A sequence of instructions for the computer is called a program. The s/w various categories: 1. Application software 2. System software 3. Utilities software

7 7Conttd…. The H/W of computer divided into three major parts: The H/W of computer divided into three major parts: CPU:- The central processing unit contains an arithmetic and logic unit for manipulating data, a no. of registers for storing data, and controls circuits for fetching and executing instructions. CPU:- The central processing unit contains an arithmetic and logic unit for manipulating data, a no. of registers for storing data, and controls circuits for fetching and executing instructions. Memory:- The memory of computer contains storage for instruction s and data. It is called RAM. It divide into two parts : 1) Primary 2) Secondary. Memory:- The memory of computer contains storage for instruction s and data. It is called RAM. It divide into two parts : 1) Primary 2) Secondary. IOP:- The input and output processors (IOP) contains electronics circuits for communicating & controlling the transfer of information between the computer and console world IOP:- The input and output processors (IOP) contains electronics circuits for communicating & controlling the transfer of information between the computer and console world

8 8 Conttd… Fig:- Block Diagram of digital computer Fig:- Block Diagram of digital computer

9 9Conttd…. Computer Organization:- Computer Organization is concerned with the way the hardware components operate and the way they are connected together to form the computer system Computer Organization:- Computer Organization is concerned with the way the hardware components operate and the way they are connected together to form the computer system Computer Design:- Computer design is concerned with the h/w design of computer. Once the computer specification are formulated, it is the task of the designer to develop the hardware for the system. It means what hardware should be used and how the parts are connected together. Computer Design:- Computer design is concerned with the h/w design of computer. Once the computer specification are formulated, it is the task of the designer to develop the hardware for the system. It means what hardware should be used and how the parts are connected together. Computer Architecture:- Computer architecture is concerned with the structure and behavior of the computer as seen by the user. It includes the information, formats, the instruction set, and techniques for addressing memory. It also concerned with various functional modules, such as processors and memory, and structuring them together into computer system. Computer Architecture:- Computer architecture is concerned with the structure and behavior of the computer as seen by the user. It includes the information, formats, the instruction set, and techniques for addressing memory. It also concerned with various functional modules, such as processors and memory, and structuring them together into computer system.

10 10 Concepts of layers in C.A Fig:- Layered View of Computer System Application Program Application Design System Design Computer Design Logic Design Circuit Design Computer Design Computer Organization C.A Software Hardware High Level Low Level

11 11 Conttd… Hardware Designer (Construction Engineer) Computer Architecture (Building Architecture) Thinks about circuits, Components, Timing, Functionality, Ease of use debugging. Thinks about high level components, How they fit together & work together to deliver performance. C.A= Machine Organization + Instruction Set Architecture (what’s machine look like) ( How u Talk to machine)

12 12 The internal architecture of the 8085 CPU is capable of performing the following operations:   Store 8-bit data (Registers, Accumulator)   Perform arithmetic and logic operations (ALU)   Test for conditions (IF / THEN)   Sequence the execution of instructions   Store temporary data in RAM during execution The 8085: CPU Internal Structure

13 13 Intel 8085 Pin Configuration

14 14 Signals and I/O Pins

15 15 Intel 8085 CPU Block Diagram

16 16 The 8085: CPU Internal Structure

17 17 The 8085: Registers

18 18 Registers   Six general purpose 8-bit registers: B, C, D, E, H, L   They can also be combined as register pairs to perform 16-bit operations: BC, DE, HL   Registers are programmable (data load, move, etc.) Accumulator   Single 8-bit register that is part of the ALU !   Used for arithmetic / logic operations – the result is always stored in the accumulator. The 8085: CPU Internal Structure

19 19 The Program Counter (PC) This is a register that is used to control the sequencing of the execution of instructions. This register always holds the address of the next instruction. Since it holds an address, it must be 16 bits wide. The Stack pointer The stack pointer is also a 16-bit register that is used to point into memory. The memory this register points to is a special area called the stack. The stack is an area of memory used to hold data that will be retreived soon. The stack is usually accessed in a Last In First Out (LIFO) fashion. The 8085: CPU Internal Structure

20 20 The 8085 and Its Busses The 8085 is an 8-bit general purpose microprocessor that can address 64K Byte of memory. It has 40 pins and uses +5V for power. It can run at a maximum frequency of 3 MHz. The pins on the chip can be grouped into 6 groups: Address Bus. Data Bus. Control and Status Signals. Power supply and frequency. Externally Initiated Signals. Serial I/O ports.

21 21 The 8085 Bus Structure The 8-bit 8085 CPU (or MPU – Micro Processing Unit) communicates with the other units using a 16-bit address bus, an 8-bit data bus and a control bus.

22 22 The Address and Data Busses The address bus has 8 signal lines A8 – A15 which are unidirectional. The other 8 address bits are multiplexed (time shared) with the 8 data bits. So, the bits AD0 – AD7 are bi-directional and serve as A0 – A7 and D0 – D7 at the same time. During the execution of the instruction, these lines carry the address bits during the early part, then during the late parts of the execution, they carry the 8 data bits. In order to separate the address from the data, we can use a latch to save the value before the function of the bits changes.

23 23 The Control and Status Signals There are 4 main control and status signals. These are: ALE: Address Latch Enable. This signal is a pulse that become 1 when the AD0 – AD7 lines have an address on them. It becomes 0 after that. This signal can be used to enable a latch to save the address bits from the AD lines. RD: Read. Active low. WR: Write. Active low. IO/M: This signal specifies whether the operation is a memory operation (IO/M=0) or an I/O operation (IO/M=1). S1 and S0 : Status signals to specify the kind of operation being performed.Usually un-used in small systems.

24 24 Frequency Control Signals There are 3 important pins in the frequency control group. X0 and X1 are the inputs from the crystal or clock generating circuit. The frequency is internally divided by 2. So, to run the microprocessor at 3 MHz, a clock running at 6 MHz should be connected to the X0 and X1 pins. CLK (OUT): An output clock pin to drive the clock of the rest of the system. We will discuss the rest of the control signals as we get to them.

25 25 Numbering System Many number systems are in use in digital technology. The most common number system are:- Many number systems are in use in digital technology. The most common number system are:- 1. Binary (With Radix 2) 2.Decimal(With Radix 10) 3.Octal(With Radix 8) 4.Hexadecimal(With Radix 16)

26 26 Numbering System Number SystemRadix(Base) Binary0,1 Decimal0,1,2,3,4,5,6,7,8,9 Octal0,1,2,3,4,5,6,7 Hexadecimal0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

27 27 Decimal System :- The decimal system is composed of 10 numerals or symbols. These 10 symbols are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9; using these symbols as digits of a number, we can express any quantity. The decimal system, also called the base-10 system because it has 10 digits. Decimal Number

28 28 In the binary system, there are only two symbols or possible digit values, 0 and 1. This base-2 system can be used to represent any quantity that can be represented in decimal or other number system.  In digital systems the information that is being processed is usually presented in binary form. Binary quantities can be represented by any device that has only two operating states or possible conditions. Eg. a switch has only open or closed. We arbitrarily (as we define them) let an open switch represent binary 0 and a closed switch represent binary 1. Thus we can represent any binary number by using series of switches. Binary System

29 29 The Binary counting sequence is shown in the table: Binary Counting

30 30 Any binary number can be converted to its decimal equivalent simply by summing together the weights of the various positions in the binary number which contain 1. Example 1: convert 11011 2 to decimal value 11011 = 16+8+2+1= Solve: Binary to Decimal Convertion

31 31 Example 2 : Convert 10110101 2 to decimal value Solve: 10110 = 128 + 32 + 16 + 4 + 1= 101 You should noticed the method is find the weights (i.e., powers of 2) for each bit position that contains 1, and then to add them up.

32 32 I.There are two methods to convert it:- Revese of Binary-To-Digital Method = 32 + 8 + 4 + 1 = 00 1 11 1 00 = 2 Decimal number write as the sum of square 0 & 1 is write on the byte Example 1: Convert 4510 to the binary value Solve = Decimal to Binary Conversion

33 33 ii.Repeat division method The numbers is divide by 2. Balance for the question is written until the last answer. 25 10 = ? 2 25 2 =12 balance 1 12 2 =6 balance 0 6 2 =3 balance 0 3 2 =1 balance 1 1 2 =0 balance 1MSB LSB... Answer = 11001 2 Example : convert 25 10 to binary Solve =

34 34 The Flow chart for repeated-division method is as follow:

35 35 The octal number system has a base of eight, meaning that it has eight possible digits: 0,1,2,3,4,5,6,7.  Use to represent long binary numbers in computers and microprocessors. Octal Number System

36 36 Convert from octal to decimal by multiplying each octal digit by its positional weight. Example 1: Convert 163 8 to decimal value Solve = =1 x 64 + 6 x 8 + 1 x 1 115 10 = Example 2: Convert 333 8 to decimal value Solve = =3 x 64 + 3 x 8 + 3 x 1 219 10 = Octal to Decimal Conversion

37 37 Convert from decimal to octal by using the repeated division method used for decimal to binary conversion. Divide the decimal number by 8 The first remainder is the LSB and the last is the MSB. 359 10 = ? 8 359 8 =44 balance 7 44 8 =5 balance 4 5 8 =0 balance 5MSB LSB... Answer = 547 8 Example : convert 359 10 to Decimal Value Solve = Decimal to Octal Conversion

38 38 Convert from octal to binary by converting each octal digit to a three bit binary equivalent Octal digit01234567 Binary Equivalent 000001010011100101110111  Convert from binary to octal by grouping bits in threes starting with the LSB.  Each group is then converted to the octal equivalent  Leading zeros can be added to the left of the MSB to fill out the last group. Octal to Binary Conversion

39 39

40 40 Can be converted by grouping the binary bit in group of three starting from LSB Octal is a base-8 system and equal to two the power of three, so a digit in Octal is equal to three digit in binary system. Binary to Octal Conversion

41 41

42 42 The hexadecimal system uses base 16. Thus, it has 16 possible digit symbols. It uses the digits 0 through 9 plus the letters A, B, C, D, E, and F as the 16 digit symbols.  Use to represent long binary numbers in computers and microprocessors.  These digits can use to program machine language. Hexadecimal Number System

43 43

44 44 (3 A E) = ( 0011 1010 1110 ) (Hexa to Binary) 16 2 (2 A F) = 2 * 16 + 10 *16 + 15 * 16 2*256 + 10*16 + 15*1 (687) (Hexa to Decimal) 120 10 (5 A 8) = ( 0101 1010 1000 ) (010 110 101 000) = (2650) (Hexa to Octal) 2 2 8

45 45 Representation of Data in Computer The binary no. system is most nature for computer. Computer stores information in flip-flops. Which are two state devices. Three systems are widely used for representing both positive and negative numbers: The binary no. system is most nature for computer. Computer stores information in flip-flops. Which are two state devices. Three systems are widely used for representing both positive and negative numbers: 1. Sign magnitude representation 2. 1’s complement representation 3. 2’s complement representation Integers are represented using fixed point representation. Real no. in floating point representation. Integers are represented using fixed point representation. Real no. in floating point representation.

46 46 Conttd… Sign Magnitude Representation:- Sign Magnitude Representation:- -> 0 for Positive -> 1 for Negative The sign of no. is represented using the left most bit. A no. of n bits can be represented as n+1 bit number, where (n+1) bit is sign bit and rest n bits represents its magnitude. +12 [ 0, 0001100] -12 [ 1, 0001100] N-bits magnitude 1-bit sign

47 47 Conttd… 1’s Complement Representation:- In 1’s complement representation, negative values are obtained by complementing each bit of the corresponding positive number. Disadvantage : +0 is represented as 0000000 +1 is represented as 1111111 2’s Complement Representation:- In 2’s complement representation, negative number is obtained by adding 1 to 1’s complement representation. 1. Only one representation for 0. 2. Subtraction is carried out like addition.

48 48 Binary Arithmetic Addition’s InputSumCarry 0000 0110 1010 1101 Subtraction InputDifferenceBorrow 0000 0111 1010 1100

49 49 Signed Addition or Subtraction 2’s complement representation is best choice for addition of two signed numbers or for finding difference of two no. If X and Y two positive number then: 2’s complement representation is best choice for addition of two signed numbers or for finding difference of two no. If X and Y two positive number then: X – y = x + 2’s complement of y -x – y = 2’s complement of x + 2’s complement of y -X + y = 2’s complement of x + y

50 50 NumberBinary Equivalent2’s Complement 550011011111001001 270001101111100101 (1) 55 + 27 (2) -55 + 27 (3) 55 – 27 (4) -55 – 27 Exa :- Find the value using 2’s complement arithmetic. 55 00110111 + 27 00011011 82 01010010 - 55 11001001 + 27 00011011 - 28 11100100 2’s comp of 11100100 =00011100 55 00110111 - 27 11100101 28 00011100 - 55 11001001 - 27 11100101 - 82 10101110

51 51 Carry Look Ahead Adder In ripple carry adders, the carry propagation time is the major speed limiting factor. In ripple carry adders, the carry propagation time is the major speed limiting factor. Most arithmetic operations, are implemented using several add/subtract steps. Thus, improving the speed of addition will improve the speed of all other arithmetic operations. So, reducing the carry propagation delay of adders is of great importance. The principle of carry look-ahead solves this problem by calculating the carry signals in advance, based on the input signals.

52 52 Conttd…. This type of adder circuit is called as carry look-ahead adder (CLA adder). It is based on the fact that a carry signal will be generated in two cases: This type of adder circuit is called as carry look-ahead adder (CLA adder). It is based on the fact that a carry signal will be generated in two cases: (1) when both bits Ai and Bi are 1, or (1) when both bits Ai and Bi are 1, or (2) when one of the two bits is 1 and the carry-in (carry of the previous stage) is 1. (2) when one of the two bits is 1 and the carry-in (carry of the previous stage) is 1. The Figure shows the full adder circuit used to add the operand bits in the ith column; namely Ai & Bi and the carry bit coming from the previous column (Ci ).

53 53 Conttd…. In this circuit, the 2 internal signals Pi and Gi are given by: Pi = Ai ⊕ Bi =……………………..(1) Gi = AiBi=……………….……(2) The output sum and carry can be defined as : Si = P ⊕ Ci=……………………(3) Ci+1 = Gi + CiPi+=…………(4) Gi is known as the carry Generate signal since a carry (Ci+1) is generated whenever Gi =1, regardless of the input carry (Ci). Pi is known as the carry propagate signal since whenever Pi =1, the input carry is propagated to the output carry, i.e., Ci+1. = Ci

54 54 Conttd…. C1 = G0 + P0C0 C2 = G1 + P1C1 = G1 + P1 (G0 + P0C0) = G1 + P1G0 + P1P0C0 C3 = G2 + P2C2 = G2 + P2G1 + P2P1G0 + P2P1P0C0 C4 = G3 + P3C3 = G3 + P3G2 + P3P2G1 + P3P2P1G0 + P3P2P1P0C0

55 55 Conttd… First level: Generates all the P & G signals. Four sets of P & G logic (each consists of an XOR gate and an AND gate). Output signals of this level (P’s & G’s) will be valid after 1τ. Second level: The Carry Look-Ahead (CLA) logic block which consists of four 2-level implementation logic circuits. It generates the carry signals (C1, C2, C3, and C4) as defined by the above expressions. Output signals of this level (C1, C2, C3, and C4) will be valid after 3τ. Third level: Four XOR gates which generate the sum signals (Si) (Si = Pi ⊕ Ci). Output signals of this level (S0, S1, S2, and S3) will be valid after 4τ. Thus, the 4 Sum signals (S0, S1, S2 & S3) will all be valid after a total delay of 4τ compared to a delay of (2n+1)τ for Ripple Carry adders. For a 4-bit adder (n = 4), the Ripple Carry adder delay is 9τ. The disadvantage of the CLA adders is that the carry expressions (and hence logic) become quite complex for more than 4 bits. Thus, CLA adders are usually implemented as 4-bit modules that are used to build larger size adders.

56 56 Review of Lecture Review of Lecture We have learned today the following topics Principles of computer design. Software hardware Interaction. Cost benefit concept of layers in architecture design. Introduction to 8085. Number System. Binary Arithmetic. Carry look ahead Adder.

57 57 THANKS


Download ppt "1 COMPUTER ARCHITECTURE (LECTURE) By Baljinder Singh Assistant Professor (CSE/IT) Beant College of Engg. & Technology, Gurdaspur."

Similar presentations


Ads by Google