Assembler Computer Organization and Architecture by Ravinder Nath Rajotiya - December 29, 2022January 1, 20230 Introduction Computer instructions are referenced from Instruction Types here for the purpose of reference. These are used by the assembler while translating the symbolic code to its binary code. Instructions were categorized as MRI Instructions : Direct or indirect memory reference instructions Non-MRI instructions: Instructions does not make a reference to memory, These are register reference or the I/O reference type of instructions. Category or Type of Programming languages Computer or specifically the processor understands and can execute the binary language programs only. Programs written in any other language must be translated to the machine or binary language. The programs may be developed using one of the following types of programming languages: Binary or machine level language: This is the computer natural programming language that
Addressing Modes Computer Organization and Architecture by Ravinder Nath Rajotiya - December 21, 2022December 21, 20220 Addressing Modes The instruction format for a general purpose computer was described in Instruction Types states that the OP-Code field specifies the operation to be performed, data is required to be supplied to ALU for this operation. Addressing Mode The way the data or the operands are chosen during the execution of a program depends on how the data is to be supplied since data may come from input devices, from memory or from registers etc. So, the addressing mode specifies the rule or the methods for interpreting the address fields of the instruction before the operand is actually referred. Purpose of the addressing modes: To give programming versatilities to the user by providing different ways of addressing or referencing to data such as naming variables,
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
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
Dictionary in Python PYTHON by Ravinder Nath Rajotiya - March 28, 2022March 29, 20220 DICTIONRY IN PYTHON Dictionary is a composite data type. It is used to represent records. The items in dictionary are represented by the key: value pairs. Declaration : A dictionary is declared by enclosing a comma-separated list of key-value pairs in curly braces. The value of an item is always accessed by using its key, therefore the key must be a unique name. Example dict={<key1> : <value>, <key2> : <value>, <key3> : <value>.......<keyn> : <value>} Th following define a dictionay that maps the capital to its country. capital_country = {‘Delhi’ : ‘India’, ‘Karachi’, ‘Pakistan’, ‘Kathmandu’ : ‘Nepal’ } Dictionary in python is similar to List in python. Let us see the similarty and differences between list and dictionary LIST DICTIONARY Is mutable Is mutable Can grow and shrink Can grow and