Iteration in Python PYTHON by Ravinder Nath Rajotiya - April 19, 2022April 22, 20220 Iteration- for and while loop: Iterations are used for repetitive execution of the same block of code over and over. Loop or iteration are popular block of code in all the programming language like basic, PASCAL, C, JAVA, PHP and all others. They can be numeric or collection based. Type of Iteration There are two types of iteration: a) Definite iteration, in which the number of repetitions is specified explicitly in advance. This is implemented using the for loop. b) Indefinite iteration, in which the code block executes until some condition is met. This type of iteration is implemented using the while loop How to check if an object is iterable? we can check whether an object is itrable r not by passing it to the
GGSIPU Mid-Term-1 April 2022 Solution Microprocessors by Ravinder Nath Rajotiya - April 11, 2022April 11, 20220 Solution MT-1 April 2022 ETEE 310 Microprocessors and Microcontrollers Time 1.5 Hours MM: 30 Q1. Differentiate between PC and SP Sl PC SP 1 Program counter (PC) points to the next instruction in memory to be executed Stack Ponter(SP) points to the top of the stack memory from where an item could be accessed 2 It is auto incremented for normal sequential program Incremented for PUSH and for POP operation an item accessed and the SP decremented for stack-up configuration Q1. (b) Briefly describe different memory technologies used in microprocessor system. A microprocessor system does not contain any memory internally other than the set
Set in Python PYTHON by Ravinder Nath Rajotiya - April 10, 2022April 11, 20220 SETS in PYTHON A set is an unordered collection of items. Every element of a set is unique, i.e. there are no duplicate. A set itself is a mutable i.e. we can add or remove items in a set. Items of a set are immutable i.e. we cannot modify items of a set using its index. A set is declared using {} or in-built set() function How many items in a set: A set can have any number of integer, float, tuple, string types etc s={3,5,”Hello”, 3.14} What cannot be in a set: A set cannot have mutable elements like lists, sets or dictionaries as its elements. So it will be wrong to create a set: >>>s={3,5, [6,7], 3.14} error – set cannot have list as the set
8086 memory Interfacing Technique Uncategorized by Ravinder Nath Rajotiya - March 30, 2022March 30, 20220 Interfacing memory with 8086 microprocessor To interface the memory with 8086, we need the system bus and the control signals for memory read and write operations. The system bus was generated by demultiplexing the A19/S6 ---A16/S3 and AD15—AD0 lines using the latches such as 74373 thus giving us the address lines A19-A0 and data bus as D15-D0. The IO and memory read and writes signals are generated from M/IO’, RD’ and Wr’ as shown in the table below. But for memory interfacing we will be using MEMR' and MEMW' signals for memory read and memory write: M/IO’ RD’ WR’ Operation 0 0 0 Invalid operation 0 0 1 IO read 0 1 0 io write operation 0 1 1 Invalid operation for read or write 1 0 0 Invalid operation 1 0 1 MEMR memory read 1 1 0 MEMW memory write operation 1 1 1 Invalid operation for read or write Figure below shows the hardware circuit used
8086 memory Organization 8086 Microprocessor by Ravinder Nath Rajotiya - March 30, 2022March 30, 20220 8086 supports 1M byte of memory. To address 1MB, we need 20 address lines and the 20 bit address ranges from 00000000000000000000 –to- 11111111111111111111 i.e. 00000h to FFFFFh. The memory is constructed using RAM and ROM /EEPROM chips. 1MB memory can be contagiously organized as memory or can be organized in banks of odd and even address memory so as to access 8 or 16 bit of data. The 8-bit data thus we can either access bytes from even address on data lines D0-D7 and data from odd address on the data bus D8-D15. Approached to Memory organization: i. As one contiguous block: Memory can be organized as one contiguous block of memory as in 8085 based systems. In this case 8-bit data