Computer Organisation and Design: Difference between revisions

From bibbleWiki
Jump to navigation Jump to search
Line 66: Line 66:
*Resolution is Range / By number of intervals which is 300 / 2⁸-1  (We minus one because we need the min and max for 1 byte) = 1.1764
*Resolution is Range / By number of intervals which is 300 / 2⁸-1  (We minus one because we need the min and max for 1 byte) = 1.1764
[[File:ADC Explained.jpg|700px]]
[[File:ADC Explained.jpg|700px]]
=Sampling and Sample Rates=
Sampling Rate (Hz) = Number of samples /second. Nyquist Theorem suggests we need to same 2 as often as max<br>
Average Ears here at 20Khz hence why audio is at 44.1 kHz<br>

Revision as of 04:28, 26 January 2023

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

ADC Explained

Really like this explanation for ADC. Obvious once you know. The bit depth represents how many divisions there are between the max and min values you are allowing. The image show an american cooker and they are using the following

  • Min 300°F - Max 500°F
  • Range is 200°F
  • Bit Depth 8-bits
  • Resolution is Range / By number of intervals which is 300 / 2⁸-1 (We minus one because we need the min and max for 1 byte) = 1.1764

Sampling and Sample Rates

Sampling Rate (Hz) = Number of samples /second. Nyquist Theorem suggests we need to same 2 as often as max
Average Ears here at 20Khz hence why audio is at 44.1 kHz