Skip to content

Instantly share code, notes, and snippets.

Q1 (100 points): The average CPI (cycles per instruction) for different kinds of instructions for a computer is given in the table below, together with the frequency of each type of instruction for a given program P.

Operation Frequency CPI
Fixed-point ALU 40% 2
Floating point 20% 15
Load 20% 5

Eventuella chapters utifrån arkitektur

Vi har skissat på lite olika chapters, väldigt löst, och försökt resonera (kort) om vad för dependencies som uppstår mellan dem, vi utgick först från våran arkitektur

Lager
Front-end (Web UI)
Web Server

Architecture layout

The primary constituents of the system are,

  • User-facing (video covered, login and LMS integration is not)
  • Processing (not covered in detail)
  • Storage (not covered at all)

User-facing

Keybase proof

I hereby claim:

  • I am leksak on github.
  • I am filipallberg (https://keybase.io/filipallberg) on keybase.
  • I have a public key ASCTmSb5iqIvdESElgPWZHHt3PDLL7zF3s46ooGc7zaGeQo

To claim this, I am signing this object:

@leksak
leksak / get_fully_qualified_domain_name.py
Last active December 30, 2015 08:02
Get the fully qualified domain name of the host where the function is executed.
#!/usr/bin/env python
"""
The above is the most portable shebang,
#!/usr/bin/env python
is more portable because in general the program /usr/bin/env can be
used to "activate" the desired command without full path.
@leksak
leksak / compile.sh
Last active December 25, 2015 14:39
A (standalone) sample input-output example in TikZ which is compiled with a designated output file.
# The command used to compile the above, will create an outputted pdf and a png file.
pdflatex --shell-escape compiler.tex
@leksak
leksak / l-system.hs
Created December 21, 2015 22:29
Represent arbitrary D0Ls
data D0L m a = D0L { axiom :: m a
, rules :: a -> m a
}
appliedTo :: Monad m => (a -> m b) -> m a -> m b
appliedTo = flip (>>=)
eval :: Monad m => D0L m a -> D0L m a
eval (D0L axiom rules) = D0L (rules `appliedTo` axiom) rules
@leksak
leksak / decimal_expansion_difference.m
Created December 21, 2015 09:42
Inspect differing digits in decimal expansion
function [n, difference] = decimal_expansion_difference(target, actual, pertinent_digits)
%DECIMAL_EXPANSION_DIFFERENCE Inspect differing digits in decimal expansion
%
% INPUT:
% target the target value.
% actual the computed value, its distance must be < 1 away from target.
% If violated you will incur an assertion error.
% pertinent_digits an upper bound for beyond which we stop caring about the amount
% of differing digits in the decimal expansion.
%
@leksak
leksak / HeterogeneousContainer.java
Created November 26, 2015 13:08
Found in my old source-code
/**
* Provides the necessary interface for a typesafe heterogeneous
* container, where the key and the return type is parametrized.
*
* A parametrized key is used to insert and retrieve values. By
* utilising the generic type system the type of the value returned is
* guaranteed to be the same as its key.
*
* The parametrized return value is to allow for a facsimile to a
* builder pattern, leading to brevity of expression for adding
@leksak
leksak / layered-architecture-exam-151030-Q1.md
Created November 25, 2015 18:54
Proposed solution to an exam question

Computer communication and computer networking (Datakommunikation och datornät, DOD)

Exam 2015-10-30. Question 1.

Within computer networking one often speaks of a layered architecture.

  • Question 1.1 What does one mean by this term, i.e. layered architecture?

Answer: With a layered architecture one is referring to a system that is modularized in such a way that the system is composed in layers where each layer provides a