Study Web

IT

Computer System

COS10004 - Covers Boolean algebra, Logisim simulation, digital logic, number systems, data representation, ARM assembly programming, and CPU architecture at Swinburne University.

Practice Mode
Boolean gates Logisim circuits ARM flow

Digital Logic Foundations

Gates and Boolean Algebra Logic gates are the fundamental building blocks of digital circuits. Boolean Algebra provides the mathematical framework to analyse and design gate networks. Truth Tables and De Morgan's Laws Truth tables are systematic tools for evaluating Boolean expressions. De Morgan's Laws allow transformation between AND/OR forms, essential for circuit simplification. Logisim Basics Logisim Evolution is a free, cross-platform digital logic simulator used to design, build, and test gate circuits visually. This lesson covers the interface, components, and workflow. Half and Full Adders Adder circuits are the foundation of arithmetic in digital computers. The half adder adds two bits; the full adder extends this with a carry-in, enabling multi-bit addition. Programmable Gates and Data Routing Beyond basic logic gates, digital systems use multiplexers to route data, decoders to select outputs, and flip-flops to store state. This lesson covers combinational data routing circuits.

Week 1

Resources you need COS10004 Computer Systems Lecture 1.2 – Resources you need Dr Chris McCarthy LECTURE 1.2 OVERVIEW > Digital Circuit Design: – Logisim > Assembly Programming – Raspberry Pi • And associated hardware – FASMARM assembler > Summary 30/7/20 COS1 Computers – a historical perspective COS10004 Computer Systems Lecture 1.3 Computers – a historical perspective Dr Chris McCarthy _start: 30/7/20 COS10004 Computer Systems 2 INFORMATION AND COMPUTERS > What is information? > Computing requirements to process information: repre Bits and Number Systems COS10004 Computer Systems Lecture 1.4 Bits and Number Systems Dr Chris McCarthy INFORMATION AND COMPUTERS > Multiple bit representation of information: – numbers (32 bits) -> double/float; int – Characters (8 bits) -> ASCII chars > Numerica Gates and Digital Logic COS10004 Computer Systems Lecture 1.5 Gates and Digital Logic Dr Chris McCarthy What is a Gate? > A gate is an electronic component (e.g. transistors connected together) whose output is determined by its input. – There may be from 4 gates o Combinational Circuits – The Half Adder COS10004 Computer Systems Lecture 1.6 Combinational Circuits - The Half Adder Dr Chris McCarthy COMBINATIONAL CIRCUIT > A combinational circuit is a connected arrangement of logic gates with the set of inputs and outputs. > A combinational

Week 2

Clocks (and introducing the ALU) COS10004 Computer Systems Lecture 2.2 – Clocks (and introducing the ALU) Dr Chris McCarthy GATES ARE NOT INSTANTANEOUS Changing the state of a gate takes some finite time. X Y S Ci What’s the issue here ? 2 7/8/20 COS10004 Computer Systems Storing bits – RS Flip Flops COS10004 Computer Systems Lecture 2.2 – Storing bits - RS Flip Flops Dr Chris McCarthy WHAT IS A COMPUTER SYSTEM? Fast memory Persistent (RAM) memory (Disks - program and data and other non- volatile memory) Central Mother Graphics processi Clocked Flip Flops (D, JK and T FFs) COS10004 Computer Systems Lecture 2.4 – Clocked Flip Flops (D, JK and T FFs) Dr Chris McCarthy BASICS OF ELECTRONIC STORAGE - CPU REGISTERS > In a computer the output is determined by current inputs and memory (previous inputs) computed tog More Adders and Programmable Gates COS10004 Computer Systems Lecture 2.1 – More Adders and Programmable Gates Chris McCarthy Half-adder The XOR gate calculates the sum Two bits (two The AND gate one-bit inputs/ calculates the variables) carry 7/8/20 2 COS10004 Computer Syste

Week 3

Counters and Shift Registers COS10004 Computer Systems Lecture 3: Counters and Shift Registers Dr Chris McCarthy Building a computer? Things we need: memory within Fast memory (RAM) Persistent the CPU - program and data memory = banks (Disks) of flip- flops Instruction Counters- the ripple counter COS10004 Computer Systems Lecture 3.2: Counters- the ripple counter Dr Chris McCarthy COUNTERS IN DIGITAL LOGIC > A circuit that stores and increments the number of occurrences of an event: – Most commonly clock pulses > Two types we will c More ripple counters COS10004 Computer Systems Lecture 3.3: More ripple counters Dr Chris McCarthy 2 RIPPLE COUNTER > Ripple counters utilise the toggle setting of J-K Flip Flops: 30/7/20 COS10004 Computer Systems 3 RIPPLE COUNTER 30/7/20 COS10004 Computer Syst Common clock counter COS10004 Computer Systems Lecture 3.4: Common clock counter Dr Chris McCarthy ALTERNATIVE – COUNTER WITH COMMON CLOCK > We can avoid the illegal state by detecting the last legal state (eg., 5 in a modulo 6 counter), and then set to 0 on ne Shift Registers COS10004 Computer Systems Lecture 3.5: Shift Registers Dr Chris McCarthy SHIFT REGISTERS A shift register takes input from one end, and at each clock change this value is moved to the next D-Flip-Flop. This is used in serial data transfer w

Week 4

Counters and Shift Registers COS10004 Computer Systems Lecture 3: Counters and Shift Registers Dr Chris McCarthy Building a computer? Things we need: memory within Fast memory (RAM) Persistent the CPU - program and data memory = banks (Disks) of flip- flops Instruction Counters- the ripple counter COS10004 Computer Systems Lecture 3.2: Counters- the ripple counter Dr Chris McCarthy COUNTERS IN DIGITAL LOGIC > A circuit that stores and increments the number of occurrences of an event: – Most commonly clock pulses > Two types we will c More ripple counters COS10004 Computer Systems Lecture 3.3: More ripple counters Dr Chris McCarthy 2 RIPPLE COUNTER > Ripple counters utilise the toggle setting of J-K Flip Flops: 30/7/20 COS10004 Computer Systems 3 RIPPLE COUNTER 30/7/20 COS10004 Computer Syst Common clock counter COS10004 Computer Systems Lecture 3.4: Common clock counter Dr Chris McCarthy ALTERNATIVE – COUNTER WITH COMMON CLOCK > We can avoid the illegal state by detecting the last legal state (eg., 5 in a modulo 6 counter), and then set to 0 on ne Shift Registers COS10004 Computer Systems Lecture 3.5: Shift Registers Dr Chris McCarthy SHIFT REGISTERS A shift register takes input from one end, and at each clock change this value is moved to the next D-Flip-Flop. This is used in serial data transfer w

Week 5

Memory COS10004 Computer Systems Lecture 4.1: Memory Dr Chris McCarthy _start: 10/8/20 COS10004 Computer Systems 2 THIS WEEK: Memory, encoders and stacks > Memory - different types > Need encoders/decoders for interrupt handling - – 4 to 2 priorit Stacks COS10004 Computer Systems Lecture 4.2: Stacks Dr Chris McCarthy STACKS > Random access memory requires knowing the address of every byte/word you want to access > Stacks offer a way of organising and accessing memory without random (indexed Let’s build a stack! COS10004 Computer Systems Lecture 4.3: Let’s build a stack! Dr Chris McCarthy STACKS > Random access memory requires knowing the address of every byte/word you want to access > Hardware stacks created out of dedicated shift registers > So l CPU architectures and memory management (stacks and caching) COS10004 Computer Systems Lecture 4.4: CPU architectures and memory management (stacks and caching) Dr Chris McCarthy STACKS AND VON NEUMANN > The most common CPU architecture. > Von Neumann architecture: Control bits and data bits share a Interrupts and Polling COS10004 Computer Systems Lecture 4.5: Interrupts and Polling Dr Chris McCarthy CPU MULTI-TASKING - INTERRUPTS > A response to a signal that needs attention from the software src: https://doc.micrium.com/display/os305/Handling+CPU+Interrupt

Week 6

Encoders , Decoders and Multiplexers COS10004 Computer Systems Lecture 5.1 Encoders , Decoders and Multiplexers Dr Chris McCarthy ENCODERS AND DECODERS > Binary signals along a wire can represent a single state, or form part of a binary code > Sometimes we want to convert betw Number Systems: Signed numbers COS10004 Computer Systems Lecture 5.2 Number Systems: Signed numbers Dr Chris McCarthy Number representation • Computers are digital systems: – data stored in the form of 0s and 1s • Computers commonly perform arithmetic operations on numbe Representing real numbers: Fixed and Floating-point COS10004 Computer Systems Lecture 5.2 Representing real numbers: Fixed and Floating-point Dr Chris McCarthy Number systems: fixed-point numbers > Integers are much easier to work with than real numbers! > What’s a real number ? – Numbers th

Week 7

ARM Assembly Programming: Getting Ready COS10004 Computer Systems Lecture 7.1 ARM Assembly Programming: Getting Ready Dr Chris McCarthy ARM Assembly Bare-metal programming for Raspberry Pi 18/9/20 COS10004 Computer Systems 2 ACKNOWLEDGEMENTS • This material is based on Baking Pi What is Assembly Programming (and why do I care) ? COS10004 Computer Systems Lecture 7.2 What is Assembly Programming (and why do I care) ? Dr Chris McCarthy _start: 18/9/20 COS10004 Computer Systems 2 WHAT IS ASSEMBLY PROGRAMMING ? • All computer processors: – Manages arithmetic, logic and Introducing ARMLite Simulator COS10004 Computer Systems Lecture 7.3 Introducing ARMLite Simulator Dr Chris McCarthy _start: 8/4/2022 COS10004 Computer Systems 2 ARMLITE SIMULATOR • Developed by Peter Higginson • Simulates a simple computer • Cut down version of a 32-bit ASM Programming: Setup for RPi COS10004 Computer Systems Lecture 7.3 ASM Programming: Setup for RPi Dr Chris McCarthy ARM ASSEMBLY PROGRAMMING • Arm: Advanced RISC Machine • The most widely used instruction set in the world: – 130 billion ARM processors produced – mobile ASM Programming: Turn on an LED (Part 1) COS10004 Computer Systems Lecture 7.4 ASM Programming: Turn on an LED (Part 1) – ASM basics Dr Chris McCarthy TURNING ON A LIGHT! • We are now ready to program, so lets start playing ! • We’re going to walk through the asm code for turning ASM Programming: Turning on an LED (Part COS10004 Computer Systems Lecture 7.5 ASM Programming: Turning on an LED (Part 2) – the GPIO chip Dr Chris McCarthy FIRST WE WIRE IT UP See https://www.youtube.com/watch?v=Rd9kvVs1lSQ for my tutorial on wiring this circuit FIRST WE WIRE IT ARM Assembly Programming – LittlEndian Memory Addressing COS10004 Computer Systems Lecture 7.5 ARM Assembly Programming – LittlEndian Memory Addressing Dr Chris McCarthy _start: 8/4/2022 COS10004 Computer Systems 2 ARMlite models “byte” addressable ARMLITE memory MEMORY ADDRESSING That is – every

Week 8

Memory Addressing, LDR and STR Memory Addressing, LDR and STR A common workflow • The CPU and ALU work with values stored locally in registers • A standard workflow for operating on values in memory: • Load value(s) into registers • Perform operations on values in regist Labels and Branching Labels and Branching Recall Labels •Labels are used to give meaningful names to locations in memory •Previously we saw this used to define variables: Eg someplace: .word 0 Defines “someplace” as a label for a memory location holding a word Conditional Branching Conditional Branching Lecture 8.3 Conditionals in programming languages •Almost all programming languages have the capability to choose to do something only if a condition is met. •Most commonly, this comes in the form of an “if” statement: Flashing an “LED” (Part 1) Flashing an “LED” (Part 1) Busy wait timer Computer Systems Lecture 8.4 Let’s simulate a flashing LED •We can simulate a flashing LED by drawing a single pixel in ARMLite’s graphical display •ARMlite has three modes of pixel graphics displa Flashing an “LED” (Part 2) Flashing an “LED” (Part 2) A Better Busy Wait Timer Computer Systems Lecture 8.5 Busy Wait v1 •Last video we applied the “dumb” busy wait timer: MOV R2, #5000000 // init number of iterations for timer MOV R2,R3 // MOV iterations into workin

Week 9

Bit-wise operations Bit-wise operations COS10004 Lecture 9.1 Bit-wise operators •Instructions that manipulate individual bits given to them in their operands •Generally best understood by considering values in their binary form •Many of these will feel familia Indirect and Indexed Memory Addressing Indirect and Indexed Memory Addressing COS10004 Lecture 9.2 LDR and STR memory addressing •We have previously discussed and seen how LDR and STR support indirect addressing • allows memory to be addressed via registers holding the address • Array Basics Array Basics COS10004 Lecture 9.3 Array basics • Arrays are dedicated blocks of memory for storing lists of values of the same type (ie size) • Almost all programming languages support arrays: • E.G in C programming: int somearray[10]; Defi Basic Array Example Basic Array Example COS1004 Lecture 9.4 Iterating though an array •Consider this psuedocode –what is it doing ? numarray[10]: {3, 2, 5, 3, 5, 6, 1, 2, 4, 9} sum = 0 i = 0 while(i < 10)do sum = sum + numarray[i] i = i + 1; end while Iteratin Extended Array Example – lowercase conversion Extended Array Example – lowercase conversion COS10004 Lecture 9.5 Array (and ASCII) example – convert to lowercase • Let’s write an ASM program that reads a string from input and converts all alphabetic characters to lower case • Algorithm

Week 10

Functions in ARM Assembly – Function basics COS10004 Computer Systems Lecture 10.1 – Functions in ARM Assembly - Function basics Chris McCarthy FUNCTIONS • Functions/methods/procedures/sub-routines: – A callable block of organised, re-usable code – Typically single action – accepts a ARM Assembly – The Software Stack COS10004 Computer Systems Lecture 10.2 ARM Assembly – The Software Stack Chris McCarthy FUNCTIONS IN ASM • Not 'native' to assembly – We need to do a lot of the management ourselves • Argument passing: – How do we pass arguments from one fu Functions in ARM Assembly -Program Counter and Link Register COS10004 Computer Systems Lecture 10.4 – Functions in ARM Assembly -Program Counter and Link Register Chris McCarthy FUNCTIONS IN ASM • Not 'native' to assembly – We need to do a lot of the management ourselves • Argument passing: – How do Functions in ARM Assembly – Nested Function COS10004 Computer Systems Lecture 10.5 – Functions in ARM Assembly - Nested Function Calls Chris McCarthy FUNCTIONS IN ASM • Not 'native' to assembly – We need to do a lot of the management ourselves • Argument passing: – How do we pass arg

Week 11

Interrupt handling Interrupt handling COS10004 Lecture 11.1 Interrupts • An interrupt is a signal or process that requests the CPU’s attention • Sources of interrupts include any peripheral device, clocked events, or program induced events • Interrupt handlin Interrupts in ARMlite Interrupts in ARMlite COS10004 Lecture 11.2 Revisiting our Flashing LED Example • Recall our flashing LED program from last week, and in particular the delay function: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; delay function ;;

Week 12

Data Communication COS10004 Computer Systems Lecture 6.1 – Data Communication Dr Chris McCarthy THIS LECTURE • Data Communications • Serial – RS-232, USB – Parity • Serial versus Parallel 4/9/20 COS10004 Computer Systems 2 DATA COMMUNICATIONS What is DATA?? •