Computer Organisation and Design

From bibbleWiki
Revision as of 04:03, 26 January 2023 by Iwiseman (talk | contribs) (Binary)
Jump to navigation Jump to search

Introduction

This is me looking at theory and documenting what I need to know. Primarily this was driven from my electronics and not IT.

Pulse Trains

  • Non-Periodic pulse trains are digital signals with any pulses over time
  • Periodic pulse trains are pulses in fixed time like a clock signal
    • T=period (seconds/cycle)
    • tw = pulse width
    • frequency = cycles/second or frequency = 1/T
    • duty cycle = % of time period train = 1 or tw /T x 100%

Binary

Lots of talk about binary and how it works. This is a placeholder to remind me we needed to know about this. Good terms were

  • LSB Least significant bit
  • MSB Most significant bit

BCD Binary Code Decimal

This is where we encode a number using the digits rather than the value e.g. we encode 94 as a '9' and a '4'

In BCD 94 would 
1001 0100
9    4  

Multiplications and Divisions

Distributive law was mentioned. You can solve a problem using the order of operations using distributive law.

Given 5(3+4)

Order of operations would be 5(7) = 35
Distributive law would be (5x3)+(5x4) = 15 + 20 = 35

We looked at doubling a number below where each value could be solved with

 3x2 or (2 x 2) + (2 x 1) = 6
 6x2 or (2 x 4) + (2 x 2) = 12
12x2 or (2 x 8) + (2 x 4) = 24


 3 = 2  +   1 = 00000011
 6 = 4  +   2 = 00000110
12 = 8  +   4 = 00001100
24 = 16 +   8 = 00011000 
48 = 32 +  16 = 00110000
96 = 64 +  32 = 01100000

192 = 128 + 64 = 11000000

We can multiply easily using the shift operators e.g.

a = a * 16 or 2 to the power of 4 or
a = a << 4;

Or divide with >>

b = b/8
b = b >> 3 

Converting to Binary

Let take 89 and continue to divide by 2

 89 / 2 = 44 rem 1 - LSB
 44 / 2 = 22 rem 0
 22 / 2 = 11 rem 0
 11 / 2 =  5 rem 1
  5 / 2 =  2 rem 1
  2 / 2 =  1 rem 0
  1 / 2 =  0 rem 1
 Therefore taking answers in reverse 89 = 01011001