MedVision ad

2014 COMP finals thread. (3 Viewers)

anomalousdecay

Premium Member
Joined
Jan 26, 2013
Messages
5,766
Gender
Male
HSC
2013
I'm not doing the course(s) but I'll be interested in this thread to see how different software languages are to hardware languages.

Enjoy.
 

anomalousdecay

Premium Member
Joined
Jan 26, 2013
Messages
5,766
Gender
Male
HSC
2013
With code take your time to think through things and check what you are doing.

Its very easy to do everything and then end up getting a result which is not what you want (from experience). And then just a few changes (maybe a few different things here and there) can make all the difference by maybe making it work or maybe ruining everything.
experienced that just then lol.

segment of my code:

for (i = 0; string != '\n'; i++) {
if (string != '\n' && string != '\0') {
count++;
} else {
continue;
}
}

it should be || lel fak gg


wat is dis gibberish

- from engg1811 student lel
It's a counter - from a COMP1911 student who was and should be enrolled in 1917 but found it too hard lel
experienced that just then lol.

segment of my code:

for (i = 0; string != '\n'; i++) {
if (string != '\n' && string != '\0') {
count++;
} else {
continue;
}
}

it should be || lel fak gg


I'm not talking about syntax errors though. I'm talking about description errors. Like if you try to use an if or case statement then you need to make sure that you do everything in correct order. Especially since C deals with everything line by line in order. See I'm used stuff that does things simultaneously without worrying about order because of the languages I've learnt so that is a minimal error with what HDL does.

Only thing I understand from that (I have not done C yet only have done HDL) is that you have made a counter.

However in verilog for example we do this:

if (counter1 == parameter) begin /* the parameter is a number which is synchronous with a physical counter or some other counter so what we are doing is making a clock cycle here */
{counter2} = {counter2} + 1;
end


Or I could do something like this:


module AD (input A, input B, input C, output Z, output Y, output X);

assign Z = A&B&C;
assign Y = A^B^C;
assign X = ~Y&(Z^Y);

endmodule



So that all happens simultaneously so that a voltage is applied to all the elements used simultaneously.

Again this is for HDL though so it has nothing to do with software languages.


Continue.
 

anomalousdecay

Premium Member
Joined
Jan 26, 2013
Messages
5,766
Gender
Male
HSC
2013
/*
*/

module who_just_posted (input [25:1] post, input [5:1] page, output poster_id [31:0], output [125:1]);

parameter "anomalousdecay" = 31'd1611098252 ;

if (post [25:1] == 5'd2 && page [5:1] = 3'd1) begin
post [25:1] = 5'd3;
poster_id [23:1] = anomalousdecay;
end
endmodule


/* guess what I just did? */
 
Last edited:

anomalousdecay

Premium Member
Joined
Jan 26, 2013
Messages
5,766
Gender
Male
HSC
2013
Can't do the email part but can do something that would be able to show how many votes someone got by a seven segment display.

In fact we already did that in a lab but we didn't use coding as that's way too long to do compared to the short method.
 

Squar3root

realest nigga
Joined
Jun 10, 2012
Messages
4,927
Location
ya mum gay
Gender
Male
HSC
2025
Uni Grad
2024
Was anyone in flute for the exam?

Yes it is a segment of C code. Lol that's the only thing I know
 

Web Addict

Member
Joined
Oct 19, 2012
Messages
462
Gender
Male
HSC
2013
Was anyone in flute for the exam?

Yes it is a segment of C code. Lol that's the only thing I know
I was in one of the CSE labs at the Old Main Building - I forgot the name.

Did anyone manage to get Q6 or Q7?
 

EpikHigh

Arizona Tears
Joined
Dec 17, 2011
Messages
499
Gender
Male
HSC
2013
my biggest mistake taking engg1811 instead of comp1911 lel
 

Web Addict

Member
Joined
Oct 19, 2012
Messages
462
Gender
Male
HSC
2013
Guessing test was alright since no one is raging
I think that's because not many people do COMP1911. Also, it's because most, if not all, people will pass as the first few questions were extremely easy, although the last two were extremely challenging.
 

Squar3root

realest nigga
Joined
Jun 10, 2012
Messages
4,927
Location
ya mum gay
Gender
Male
HSC
2025
Uni Grad
2024
Lel, I fucked up question 2 and it took me 20 min to fix it

Andrew said that usually about 10% overall fail but those are usually the people who gave up a long time ago
 
Joined
Feb 28, 2014
Messages
66
Gender
Undisclosed
HSC
N/A
AD:

=== Question 9 ===

(4 Marks)

When the following code is compiled and executed it eventually executes
the printf and terminates. What value does it print?


#include <stdio.h>
#define NINE 9

int nine (int Nein);
int nein (int nein);
int main (int argc, char *argv[]) {

...int Nine = 3;
...printf ("%d\n", nine (Nine));
...return !NINE;
}

int nein (int nein) {
...return ( !(nein == ((NINE*nein) % NINE)) );
}

int nine (int Nein) {
...int Nine = NINE;
...while (nein (Nine)) {
......Nine += Nein;
......Nine = Nine % NINE;
...}
...return Nine;
}
 

Users Who Are Viewing This Thread (Users: 0, Guests: 3)

Top