570 likes | 728 Views
COMPUTER ARCHITECTURE (LECTURE) By Baljinder Singh Assistant Professor (CSE/IT) Beant College of Engg . & Technology, Gurdaspur. CONTENTS. Principles of computer design. Software hardware interaction. Cost benefit concept of layers in architecture design. Introduction to 8085.
E N D
COMPUTER ARCHITECTURE (LECTURE) By Baljinder Singh Assistant Professor (CSE/IT) Beant College of Engg. & Technology, Gurdaspur
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.
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. • so digital computer uses the binary no. system , which has two digits: 0 and 1. 0 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.
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
Conttd…. • 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. • 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
Conttd… Fig:- Block Diagram of digital computer
Conttd…. • 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 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.
Concepts of layers in C.A High Level Application Program Application Design Fig:- Layered View of Computer System Software System Design Computer Design C.A Logic Design Hardware Computer Organization Circuit Design Computer Design Low Level
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)
The 8085: CPU Internal Structure 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 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 • 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 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.
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.
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.
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.
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.
Numbering System • 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)
Decimal Number • 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.
Binary System • 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 Counting • The Binary counting sequence is shown in the table:
Binary to Decimal Convertion • 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 110112 to decimal value Solve: 1 1 0 1 1 = 16+8+2+1 =
Example 2 : Convert 101101012 to decimal value Solve: 1 0 1 1 0 1 1 0 = 128 + 32 + 16 + 4 + 1 = 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.
Decimal to Binary Conversion I. There are two methods to convert it:- Revese of Binary-To-Digital Method • Decimal number write as the sum of square • 0 & 1 is write on the byte Example 1: Convert 4510 to the binary value Solve = 32 + 8 + 4 + 1 = 0 0 = 0 1 1 0 = 1 1 2
3 1 25 12 6 2 2 2 2 2 • Repeat division method • The numbers is divide by 2. • Balance for the question is written until the last answer. Example : convert 2510 to binary 2510 = ?2 Solve = = 12 balance 1 LSB = 6 balance 0 = 3 balance 0 = 1 balance 1 = 0 balance 1 MSB . . . Answer = 110012
Octal Number System • 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 to Decimal Conversion • Convert from octal to decimal by multiplying each octal digit by its positional weight. Example 1: Convert 1638 to decimal value Solve = = 1 x 64 + 6 x 8 + 1 x 1 = 11510 Example 2: Convert 3338 to decimal value Solve = = 3 x 64 + 3 x 8 + 3 x 1 = 21910
5 359 44 8 8 8 Decimal to Octal Conversion • 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. Example : convert 35910 to Decimal Value 35910 = ?8 Solve = = 44 balance 7 LSB = 5 balance 4 = 0 balance 5 MSB . Answer = 5478 . .
Octal to Binary Conversion • Convert from octal to binary by converting each octal digit to a three bit binary equivalent • 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.
Binary to Octal Conversion • 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.
Hexadecimal Number System • 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.
(3 A E) = ( 0011 1010 1110 ) (Hexa to Binary) 2 16 (2 A F) = 2 * 16 + 10 *16 + 15 * 16 2*256 + 10*16 + 15*1 (687) (Hexa to Decimal) 2 1 0 10 (5 A 8) = ( 0101 1010 1000 ) (010 110 101 000) = (2650) (Hexa to Octal) 2 2 8
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: 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.
Conttd… 1-bit sign N-bits magnitude • 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]
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.
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: • 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
Exa :- Find the value using 2’s complement arithmetic. • 55 + 27 • -55 + 27 • 55 – 27 • -55 – 27 - 55 11001001 + 27 00011011 - 28 11100100 2’s comp of 11100100 =00011100 55 00110111 + 27 00011011 82 01010010 55 00110111 - 27 11100101 28 00011100 - 55 11001001 - 27 11100101 - 82 10101110