2009 U1 Q1

  1. Part a)
  2. Part b)
    1. Explanation
  3. Part c)
  4. Part d) i)
    1. Explanation/Working:
  5. Part d) ii)
  6. Part d) iii)
  7. Part d) iv)
  8. Links to Notes
    1. Attributions to media used in this post
  9. Footnotes

Part a)

AND Gate:

AND ANSI Labelled
  A | B | A AND B
  ---------------
  0 | 0 |    0
  0 | 1 |    0
  1 | 0 |    0
  1 | 1 |    1

Or Gate:

OR ANSI Labelled
  A | B | A OR B
  ---------------
  0 | 0 |    0
  0 | 1 |    1
  1 | 0 |    1
  1 | 1 |    1

Not Gate:

NOT ANSI Labelled
  A | NOT A
  ---------
  0 |   1
  1 |   0

See this note1

Part b)

Suggested response:

XOR truth table:

ABA XOR B
000
011
101
110

Output is 1 in XOR for (NOT A AND B) OR (A AND NOT B)

Circuit:

XOR implemented with NOT gates (Inverters) and AND gates (Sum of products form)

Explanation


Assume we want to use an AND gate as a building block for our resulting circuit. Wherever we have an output of 1  it means that the inputs to that and gate should also be 1 .

If we imagine an AND gate being the last gate before the output, wherever there is a 1 we need to understand that the inputs to that gate would have to be 1.

ABA XOR B
000
011
101
110


-For each output that produces a 1, we modify the variable input to match  the modded input listed in the specific row of the table:

Row numberABA XOR BDesired output using AND Gate
i000 
ii011NOT A AND B
iii101A AND NOT B
iv110 

We see that either row ii) OR row iii)  produces a 1, i.e

(NOT A AND B) OR (A AND NOT B)

From this expression, we draw the circuit as shown in the suggested response above.

Part c)

4-to-1 multiplexer

Data Lines (Input) are denoted as x1…x4, select line are denoted as s1 and s2, Output is denoted as f

Alternative Diagram in ASCII :

        _______________________
       |        4-to-1         |
D0 ----|      Multiplexer      |
       |                       |
D1 ----|                       |---> Output
       |                       |
D2 ----|                       |
       |                       |
D3 ----|_______________________|
              |         |
              |         |
              |         |
              |         |
              S1        S0
Data Lines (Input) are denoted as D0...D3, select line are denoted as S0 and S1.

See Note2

Part d) i)

16+8+0+2+1 =27

Explanation/Working:

(0×27)+(0×26)+(0×25)+(1×24)+(1×23)+(0×22)+(1×21)+(1×20)

0+0+0+16+8+0+2+1=27

Part d) ii)


  0111 +
  1110
———-
10101 this result cannot be stored in 4 bits.

Part d) iii)


Largest number = 0111 =7 (Show conversion)
Smallest number= 1111= -ve 7 (Show conversion)

Part d) iv)

Suggestion solution 1:


Algorithm, copy all numbers from LSB to MSB up to and including the first 1, then flip remaining bits in that order, i.e
5= 0101

Applying algorithm : 1011

Suggestion solution 2:

+5= 0101
Ones = 0101+1 = 1010
Twos = 1010+1 = 1011

Attributions to media used in this post

Inductiveload, Public domain, via Wikimedia Commons


Footnotes

  1. https://islandclass.org/2021/10/20/logic-gates-formal-introduction/ ↩︎
  2. https://islandclass.org/2021/10/21/multiplexers/ ↩︎

© 2023  Vedesh Kungebeharry. All rights reserved. 

Diagrams for a Multiplexer in PNG and ASCII Art

4-to-1 multiplexer

Data Lines (Input) are denoted as x1…x4, select line are denoted as s1 and s2, Output is denoted as f

Alternative Diagram in ASCII :

        _______________________
       |        4-to-1         |
D0 ----|      Multiplexer      |
       |                       |
D1 ----|                       |---> Output
       |                       |
D2 ----|                       |
       |                       |
D3 ----|_______________________|
              |         |
              |         |
              |         |
              |         |
              S1        S0
Data Lines (Input) are denoted as D0...D3, select line are denoted as S0 and S1.

© 2023  Vedesh Kungebeharry. All rights reserved. 

2013 U1 Q1

  1. Part a) i)
  2. Part a) ii)
  3. Part a) iii)
  4. Part b) i)
  5. Part b) ii)
  6. Part b) iii)
  7. Part c)
  8. Part d) i)
  9. Part d) ii)
  10. Part d) iii)

Part a) i)

        _______________________
       |        4-to-1         |
D0 ----|      Multiplexer      |
       |                       |
D1 ----|                       |---> Output
       |                       |
D2 ----|                       |
       |                       |
D3 ----|_______________________|
              |         |
              |         |
              |         |
              |         |
              S1        S0


Part a) ii)

Set the select inputlines to 01 to select the 2nd line, and when input from the 4th line is needed after 1 second (i.e i3), set the select input lines to 11

Part a) iii)

– It always exists in 1 of 2 stable states.
-It can retain its state to achieve storage (in the case the set goes from 1 to 0)

Can be used in RAM Arrays (to implement 1 bit storage) or to Implement a Ripple Counter

Part b) i)


1101

(First bit is 1 for to represent a negative value,

working for 510 to binary :

       2 | 

       2 |2  remainder 1

       2 |1  remainder 0 

            0  remainder 1

i.e 510  = 1012

combining the result we get 11012

)

Part b) ii)


1010 (flipped bits of 0101)

Part b) iii)

1010 +1 = 1011

Part c)

(Show binary-decimal conversions)

For an unbiased exponent and unnormalized mantissa:

sign is -ve, Exponent = 2, Mantissa= 0101

i.e -0.0101 x 2­2 = -1.01

-1.012   =  (-1 x 20)+ (0 x 2-1)+ (1 x 2-2)

          = -1 + 0+ ¼

          = -1.25

Part d) i)


Not (Unary operator)

xNot X
01
10

Part d) ii)

AND

xYX AND Y
000
010
100
111

Part d) iii)

OR

xyX OR Y
000
011
101
111

© 2023  Vedesh Kungebeharry. All rights reserved. 

Simple Sorting, Subsorting Tutorial.

Step 1: Create Sample Data

First, we will create a sample dataset. We have a list of students with their names, grades, and scores.

Step 2: Enter Data in Excel

Open Excel and enter the following sample data into a new worksheet:

NameGradeScore
John SmithA99
Jane DoeA92
Mike BrownB88
Lisa RayA95
Tom HanksA98
Rita OraC55
Gary OldB82
Tina FeyC55

Step 3: Sorting Data

To sort the data:

  1. Click on any cell in the column you want to sort by (e.g., Grade).
  2. Go to the Data tab on the Excel ribbon.
  3. Click on Sort A to Z (ascending order) or Sort Z to A (descending order).

Step 4: Subsorting (Multi-level Sorting)

Subsort the data by Grade, then by Score, and finally by Name:

  1. Select any cell in the data range.
  2. Go to the Data tab on the Excel ribbon.
  3. Click on the Sort button to open the Sort dialog box.
  4. For the first level, choose Grade from the Sort by dropdown, select Values in the Sort On dropdown, and choose A to Z for the order.
  5. Click Add Level to add a second sort condition.
  6. For the second level, choose Score from the Then by dropdown, select Values in the Sort On dropdown, and choose  Largest to Smallest for the order.
  7. Click Add Level again to add a third sort condition.
  8. For the third level, choose Name from the Then by dropdown, select Values in the Sort On dropdown, and choose A to Z for the order.
  9. Click OK to apply the multi-level sort to your data.

Step 5: Review Sorted Data

What happens when 1 student has the same grade and score as another?

Sample Data

Download a file containing the sample data here:

https://drive.google.com/drive/folders/1JXTLenz8FvsX9GijfMCKkGCzQfnrlkS5?usp=drive_link

Updates to this post

2023/11/17 – Changed values for score to make the example more reasonable.

© 2023  Vedesh Kungebeharry. All rights reserved. 

Simple Chart Exercise / Tutorial (With Solution)

Simple Chart Exercise Tutorial (With Solution)

Task:

Create a bar chart which compares the income, expenses, and profit for the first four months of the year.

Setup a table as shown below with values of your choosing create the chart:

IncomeExpensesProfit
Jan
Feb
Mar
Apr

Tutorial (TA-Note)

Creating the Table:

  1. Open Excel.
  2. Click on “Cell A1” and type “Month”.
  3. Starting from “Cell A2” downwards, type the months: Jan, Feb, Mar, and Apr.
  4. Click on “Cell B1” and type “Income”. Similarly, fill in “Cell C1” with “Expenses” and “Cell D1” with “Profit”.
  5. You now have your table headings ready. You can enter your data in the cells below each heading.

Creating the Bar Chart:

  1. Select the Data: Click and drag to select the cells from A1 through D5 (assuming you have data entered till the April row).
  2. Insert a Bar Chart:
    • Go to the “Insert” tab in the Excel ribbon.
    • In the “Charts” group, click on the “Column or Bar Chart” icon (it looks like a column/bar chart).
    • A drop-down menu will appear. Choose the first option under “Clustered Bar” or any other bar chart type you prefer.
  3. Adjusting the Chart (Optional):
    • Click on the chart. This will reveal three new tabs in the ribbon: “Chart Design,” “Format,” and a third contextual tab related to the type of chart.
    • Use the “Chart Design” tab to quickly adjust the chart’s layout, style, and other elements.
    • Use the “Format” tab to refine the chart’s appearance further.
  4. Title & Labels:
    • By default, Excel might add a title, axis labels, and a legend. You can click on these elements to edit them.
    • To add labels or other elements, right-click on the chart and select the desired option from the context menu.
  5. Once satisfied with the appearance and data representation of the chart, you can save your Excel sheet.

Solution

See the attached excel file:

https://drive.google.com/drive/folders/1r78T3OnNbjDJoIxOdBOXtmkAGUboqRlT?usp=sharing

© 2023  Vedesh Kungebeharry. All rights reserved.