r/computerscience • u/lowiemelatonin • May 15 '25
Discussion Most underground and unknown stuff
Which kind of knowledge you think is really underground and interesting, but usually nobody looks up?
r/computerscience • u/lowiemelatonin • May 15 '25
Which kind of knowledge you think is really underground and interesting, but usually nobody looks up?
r/computerscience • u/Its_An_Outraage • May 14 '25
I am doing a university module of computer systems and security. It is a Time Constraint Assessment so I have little idea of what the questions will be, but I am of the assumption that it will be things like "explain the function of X". In one of the online supplementary lessons there is a brief description of a CPU and a crude diagram with modals to see more about each component, but looking at diagrams from other sources I am getting conflicting messages.
From what I've gather from the various diagrams, this is what I came to. I haven't added any data bus and control bus arrows yet, but for the most part they're just 2 way arrows between each of the components which I don't really get because I was under the impression the Fetch-Decode-Execute was a cycle and cycles usually go round linearly.
Would you say this is an accurate representation of a CPU block? If not, what specifically could I add/change/remove to improve it?
r/computerscience • u/zinc__88 • May 14 '25
I have been following Sebastian Lague's videos on YouTube and have started to make my own CPU in his Digital Logic Sim. Currently it is single cycle and I have registers A and B, a program counter, a basic ALU and ROM for the program.
My goal is to run a program that outputs the Fibonacci sequence. I have a very basic control unit which has output bits for:
With this I have made an ADD instruction which adds A and B and writes the output to A.
I now need an instruction to load a constant into either A/B. I've looked online but am quite confused how to implement this. I've seen examples which have the immediate constant, e.g.: XXXXAAAA, where X is the opcode and A is the constant (ideally I want to learn how to load 8 bit numbers, so this won't work for me).
I've seen other examples where it uses microcode and 2 bytes, e.g.: the first byte is the instruction to load a constant, and the second is the actual constant (which would allow for 8 bits).
What would be the best way to implement the microcode? Would this be possible for a single cycle CPU? Do I need an instruction register? I also don't want the CPU to execute the data, so how would I correctly increment the program counter? Just increment it twice?
r/computerscience • u/Otherwise_Plane_4048 • May 14 '25
I did a discrete math course and it was an awful time. It was online and the professor just read from the textbook. Asking question and taking note did not help.I did not drop it because it was my first time as a student in higher level education so I was scared but now I regret it. In the end they rounded up grades. It has been a while and I have forgoten what little I had learned. I know that it is used in artificial intelligent classes and others. I have the option to do the course again in different environment. But I want to know what would happen if I take these classes with no information in discrete math.
r/computerscience • u/Snoo-16806 • May 14 '25
Hi, I want to get your advice, follow Redditors, about how to manage well quality time working on my thesis.
I am in the reading stage and my thesis is on the theoretical side. I've been logging my work this first 2 weeks. I've been spending around 8 hours of total work per day on the thesis however I notice that I can only have 4h30mins average active focus. The rest of the time I just lose focus easily, I get sick of reading the same proof for an entire day or I start taking more breaks, especially on the afternoons.
I am trying to be more effective, your advise are welcome :)
r/computerscience • u/FlimsyCockroach3 • May 14 '25
Hi all,
I stumbled across the following problem.
I need to uniquely identify data in my database using an id, however I am constrained by the length. As a result, along with various other verification tools, I am sending a checksum to confirm that the Id has not changed. I am worried about collisions.
Unlike the birthday problem, I am not necessarily worried about a duplicate overall (since I am checking more than just the checksum, and the checksum is the last thing I check). Instead I think I am worried about:
How many pairs of checksums do I need to see before there is a greater than 50% of a collision? What if instead of pairs its a group with G elements and M the modulo used for my checksum?
Here is the calculation I am thinking of:
The probability of no collision is (M-1)/M * (M-2)/M * ... * (M-G+1)/M = (M-1)!/((M-G)! * M^(G-1)) = P
The probability of a collision in a group is 1 - P.
To solve for the number of groups required for the probability of a collision to be equal to 0.5 is :
0.5 = 1 - (P)^X where X is the number of groups.
Then as a follow up, I realize that I am assuming that the distribution of Ids I am checking is randomly distributed. I know for a fact that the Ids I am recieving are not random. This is leading me to consider different checksum algorithms.
The one that I am familiar with is a polynomial rolling hash that uses a large prime number for its modulo. However, when doing the calculations I am questioning whether the polynomial rolling part does anything. Further, since this Ids are generated using an algorithm (dont know which algorithm for the record), I have reason to believe that they will be sequential and I am not worried about security or checking if a bit is wrong. This leads me to two additional questions:
I apologize if this is a basic question, I do not know much about cryptography (maybe this should have went in that sub instead), and none of the basic literature I could find via google search had a satisfactory answer.
r/computerscience • u/MudCandid8006 • May 11 '25
I'm not looking for a book on coding languages, rather I'm looking to focus on the fundamentals. I've been recommended, Code: the hidden language of computer hardware and software 2nd edition. What do you all think?
r/computerscience • u/preetluvsu • May 10 '25
Flip flops are components within computer architecture which can store and manipulate data. The output of the flip flop is dependent on past events. So, could you model flip flops as a stochastic process like a Markov chain?
r/computerscience • u/Significant-Gap8284 • May 11 '25
Because Mantissa is 23 bits , I think it is meaningless to use a magnitude greater than 23, in which case you will have to skip lots of integer numbers which can only be represented with more than 23 bits . The numerical values beyond power 23 would be like , uhhhh , quantum .They are not even continuous in integer . May I ask what is the use case of a float with exponent greater than 23 ? I see the exponent can be up to 127, where are the magnitude between 23~127 to be used ?
r/computerscience • u/Due_Raspberry_6269 • May 09 '25
Link to blog: https://www.sidhantbansal.com/2025/Hashing-when-you-want-chaos/
Looking for feedback on this article I wrote recently.
r/computerscience • • May 10 '25
I see that all you guys are highly updated on coding and stuffs how do you guys maintain this .
r/computerscience • u/Smack-works • May 10 '25
I want to ask a question about algorithms, but it requires a bit of set up.
Any minimally interesting algorithm has the following properties:
Those properties are pretty trivial. Let's call them "the basic truth".
Just in case, here are some examples of how the basic truth relates to specific algorithms:
Pseudorandom number generators are counterexamples. You can't understand what a PRNG is doing before you see the output and verify that it's indeed pseudorandom. However, "generate pseudorandom numbers" is a very special kind of problem.
There are also tricky cases when an algorithm (e.g. evolution or gradient descent) creates another algorithm.
On closer inspection, the basic truth is not that basic:
What research along those lines exists, if any? That's my question.
I only find the concept of loop invariants, but it seems much less broad and isn't about proving properties of algorithms in general. Though I'm not sure about any of that.
Why researching this matters? The "key computation" is the most repeated and the most understandable and the most important part of an algorithm, so if you want to understand a hard to interpret algorithm, you probably need to identify its key computation. This matters for explainability/interpretability.
r/computerscience • u/Glad_Mix_4028 • May 08 '25
First, I watched the video several times to make sure that the lecturer in the video didn't explain the points that I didn't understand.
What exactly is Cb? Is that something I'm supposed to know before I dive into the simplex method? And why are all the values 0? And when he determined the pivot row, he replaced the third Cb value (which was 0) with -3. Why?
It may look like a dumb point to not understand, but I'm really bad at solving linear programming problems.
I humbly ask you to explain it to me like you're explaining it to a 8 yo kid.
And have a nice day!
r/computerscience • u/Prudent_Spinach_5141 • May 07 '25
I'm a student and fairly new to the entire DSA thing. I've been using c++ to solve basic problems.
Recently i discovered that python offers simple ways to carry out things that would take me hours to code in c++.
Do i just make the switch over to python or stick to c++?
r/computerscience • u/Full-Silver196 • May 05 '25
i really enjoy graph theory problems and the algorithms associated with them. i guess my question is, would becoming proficient in this theory be useful? i haven’t really found a branch of comp sci to “expertise” in and was looking for perspectives.
r/computerscience • u/andras_gerlits • May 05 '25
The use-case is that I want to add records with a certain weight and do random picks from the map with these weights driving the probabilities of picking a specific record. This would be easy enough to do, but these records need to be mutable and since it's going to be both very busy and very big (hundreds of millions of records), resizing the complete index on each modification is out of the question.
This structure is expected to be very big and busy.
So, to put it differently: If I have the elements A, B, C and D with the (respective) relative weights of 1, 2, 3, 4, the chances of picking A will be 1:10 (10=1+2+3+4). If I then remove B, the chances of picking A will be 1:8. I'm thinking if something like this doesn't exist already (as is) I could go with some kind of cross between a b-tree and a trie, where we would have multi-level indexes, but where the reading process needs to add up the values of the keys along the way, to know if they should move sideways or deeper in the tree.
r/computerscience • u/JotatD • May 04 '25
Hello buddies,
Is there a computer networks resource that isn't actually garbage?
Let me explain. I am about to graduate in Math and CS and my uni kind of failed me on the systems side. I took your typical Computer Systems - Networks - Operating Systems classes but, by luck or otherwise, these 3 were taught on a lecturer-reading-slides way.
Now, about to get my diploma, I'm clueless about networks. Is there a nice book, youtube lecture series, or something, that actually teaches you networks in the same way that other courses would teach you something hands-on? Even if theoretical? Here are some examples of what I mean.
Algorithms is hands on: problem sets that asks you to proof correctness of algorithms, computing complexity, coming up with variations of algos to solve a problem.
Data Structures is hands on: code the structures from scratch on c++.
ML is hands on: get a dataset and build a model that classifies well
SWE is hands on: Read an architecture pattern and code something with it
Math is hands on: literally just do problem sets
What resources is hands-ons in networking? I don't want to memorize that the TCP header is 8 bytes (or whatever size it is) without ever looking at it beyond the silly graph in your usual textbook. I want to solve some problems, code something up, do something. Kurose's book problem, skimming through them, feel more like High School trivia, though I might be wrong. Any help is most welcomed.
r/computerscience • u/Anonymous-badger79 • May 03 '25
I’m sorry if this isn’t the correct place to ask such a question but I didn’t this exactly breaking the rules. I’m currently studying for my algorithms final tomorrow and I’ve been conceptually struggling to understand the role of the residual graph and residual paths in finding the max-flow.
In the graph attached, when using the Ford Fulkerson algorithm with DFS, in the worst case a flow of 1 is pushed through the augmenting path repeatedly in an oscillating manner. What I’m struggling to understand is why, after the very first time that the augmenting path is found and a flow of 1 is pushed through it, causing the flow to equal capacity through the middle edge, we are still able to find the same augmenting path again and again and pass flow through it.
I’d really appreciate any help! Thanks a lot.
r/computerscience • u/Tranomial_2 • May 03 '25
What is the relation between API, driver and firmware? From what I understand API is the intermediate between the application and the driver, the driver gives the low level instructions and firmware does what?
r/computerscience • u/teivah • May 01 '25
r/computerscience • u/Significant-Gap8284 • May 01 '25
Given two arbitrary vectors, which represent a bounding box in 3D space . They represent the leftbottom and the righttop corners of a box geometry . My question is , I want to voxelize this bounding box, but I can't get a correct number of total number of boxes .
To elaborate : I want to represent this bounding volume with several little cubes of constant size . And they will be placed along each axis with different amounts per axis. This technically would be easy but soon I encountered the problem of float precision . As decimal numbers are represented with negative powers, you have to fit the numerical value . Binary representation cannot represent it easily . It's like binary tree that you divide the whole tree into "less than 0.5" and "greater than 0.5" . After that , you divide each parts into 0.25 and 0.75. You repeat this process and finally get an approximate value .
The problem is : ceil((righttop.x-leftbottom.x)/cubesize) outputs 82 while ceil(righttop.x/cubesize)-ceil(leftbottom.x/cubesize) outputs 81 because (righttop.x-leftbottom.x)/cubesize equals to 81.000001 which is ceiled to 82, while I was expecting it to be ceil(81.000001)==81 .
How should you calculate it in this case ?
r/computerscience • • Apr 30 '25
Sometimes, I get sad that most of what I build are just metaphors for electrons occupying different spaces--so I start picturing tactile representations. Here is one I designed in Fusion for Arrays and pointers.
It helped with explaining the concept to my 10 year old--although it didn't much help with the "but why?" question.
r/computerscience • u/vannam0511 • Apr 30 '25
Most of us use technological devices daily, and they're an indispensable part of our lives. A few decades ago, when the first computer came up, the screen only displayed black and white colors. Nowadays, from phones to computers to technical devices, the colorful display is what we take for granted. But there is one interesting question from a technical perspective: if the computer can only understand zeros and ones, then how can a colorful image be displayed on our screen? In this blog post, we will try to address this fundamental question and walk through a complete introduction to the image rendering pipeline, from an image stored in memory to being displayed on the screen

https://learntocodetogether.com/image-from-memory-to-display/