Some notes on Git

Basic: Create a repository: git init Add files to repository to be committed: git add filename1 filename2 ( add files to stage) Make files committed git commit -m "xxx" (commit files to branch) Check the result git status Version Control: Compare the difference git diff filename Show history git log or git log –pretty=oneline Back …

Unity 2D – Laser Defender (4)

Continued Damage dealer Create a new script file in our script folder. Add code below into the new script: using System.Collections; using System.Collections.Generic; using UnityEngine; public class DamageDealer : MonoBehaviour { [SerializeField] int damage = 100; public int GetDamage() { return damage; } public void Hit() { Destroy(gameObject); } } And then add this script …

Lambda Calculus – Studying Note

The Lambda Calculus has only one features: Function More precisely, only thing you can do is: Define a function Call a function Describing a Programming Language Syntax: what do programs look like? Semantics: what do programs mean? Syntax: What Programs Look Like Some Examples: For above examples, they are: function(x) {return x} function(x) {return function(y) …

ISA and Pipelining

ISA Instruction set architecture A well-defined hardware/software interface The “contract” between software and hardware An ISA includes a specification of the set of opcodes (machine language), and the native commands implemented by a particular processor. Single-cycle and Pipelining 5 stages of pipelining

Latency and throughput

Latency (execution time): time to finish a fixed task Throughput (bandwidth): number of tasks per unit time Calculate speed up Average performance CPU Performance CPI: Cycles/instruction IPC = 1/CPI Used more frequently than CPI Favored because “bigger is better”, but harder to compute with What is the CPI? (1 cycle+2 cycles +3 cycles) / 3 …