Search This Blog

Blog Archive

Saturday, August 24, 2013

Process Scheduling Algoithms:

Round Robin:
each process gets a strict amount of time on the CPU 
(its quantum is typically 10 to 100 ms)
seems fair
easy to implement
Round Robin is pre-emptive - its specifically designed for time-sharing systems
there is no risk of starvation*

but if the timeslice is too big round robin tends to a FCFS system
if the quantum is too small, RR tends to become 

Typically Round Robin has a better average response time than a SJF - Shortest Job First system.

A potential deficiency of Round Robin: processes that are IO-bound* often do not use their full quantum before being interrupted by an IO operation. Once blocked and evicted, they then get moved to the back of the queue, so their spot in the queue is essentially lost to another process. they go 'hungry' for CPU time

so Round Robin as a scheduling algorithm is not really as fair as it might initially seem.

* Starvation / indefinite blocking : can occur when a scheduling system leaves a lower priority job indefinitely

* IO bound Process - the process spends more time frequently interrupted by IO operations, and subject to context switches thus often doesn't use its full quantum of CPU time.

* CPU bound process - spends more time on average being executed in the CPU, 
than being interrupted by IO operations.

Youtube videos of scheduling algorithms in action:

SRTF https://www.youtube.com/watch?v=67ZDlvwgSV8SRTF
(Priority Scheduling, a 'pre-emptive verison' of SJF)


Round Robin
https://www.youtube.com/watch?v=GjrxO-PDPdk

Friday, August 23, 2013

Edsger W. Dijkstra.

...the manuscripts of Edsger W. Dijkstra, 1930–2002

http://www.cs.utexas.edu/users/EWD/

example of pathfinding from macha

Vimeo Animation: https://vimeo.com/10569955



Monday, July 22, 2013

aberration post updated

Chromatic Aberration post from aeons ago updated with link to After Effects tutorial
by Cyril Kotecky (Jul 19, 2013.)

Tuesday, April 23, 2013

tips and tricks for digital number formats, logic gates and Boolean Algebra.

from one of my colleagues - thanks Anon.
  • You must be really comfortable in interchanging between types of number representation.
  • Write down the RANGE for every number representation available in your notes.
  • A XOR B = ~AB + ~BA
  • De Morgan’s rule, De Morgan’s rule everywhere. Not only on Boolean algebra, some ALU questions have them.
  • If there seems to be no answer, try using De Morgan’s rule if appropriate.
  • From my experience, (tutors please correct me if I am wrong), using De Morgan’s rule on 3 variable also works.
  • BOOLEAN IDENTITIES, the easiest and most important including:
AA = A, A + A = A, (A+ BC) = (A+ B)(A+C), A(A+B) = A, A + AB = A

Knowing this only is not enough, you NEED practice. For those of you who are going to say “challenge accepted”, go on, make my day.


  • How to convert from one’s complement to two’s complement? add the sign to the number. e.g. 1110 in one’s complement: add the sign to the number, 1110 + 1 = 1111 in two’s complement. second example, 0110 in one’s complement: add the sign to the number, 0110 + 0 = 0110 in two’s complement.
  • Conversely, from two’s complement to one’s complement, take the sign number instead of adding.
  • Negative numbers also have odd and even.
  • Two’s complement, signed number, unsigned, excess-128: don’t affect whether it is odd or even.
  • One’s complement however, when negative: the LSB is 1 for even, 0 for odd. When positive à 0 for even, 1 for odd.
  • Binary Coded Decimal: e.g. 789, become 0111 1000 1001. Always use 4 bits for each number (since max is 9, 1001).
  • I wasted a lot of time simplifying the sum of products on questions 53 – 57 on sample midsem paper. IMO it is quicker to just sub in A B C with their value on the table and see if the result matches.
  • Use ruler for questions like q110.
  • In questions with latches, POSITION OF Q AND ~Q IS IMPORTANT AND MAY AFFECT ANSWER.
  • 2 inputs XOR gate and NAND gate can be used as an inverter. If one input is 1 and is fixed, no matter what the other input is, the output will be that other input inverted. e.g. 1 XOR A = ~A. 1 NAND A = ~A.


Friday, April 5, 2013

Designing circuits in logisim...

Logisim is great to prototype your circuits. This one worked, thankfully - as I also designed it on paper a couple of times which took a while :D

If any 2 of 3 bits of input in an incoming bitstream (B) are 1's then X will be 1,
(the X output LED will light up)
and if 3 1's re detected - the Y output will be 1
(the Y LED will light up)

You can 'poke' the clock to make it tick over after you've adjusted your inputs, or you can mke it tick automatically at a given Hz.