COA Ultimate Study Board • Detailed Interactive Edition

Computer Organization & Architecture
Detaylı İnfografik + Tıklanabilir Şema

Bu versiyonda her ana konu altında açılır ek bilgiler var. Yani sadece yüzeysel özet değil; sınav çalışırken üstten bakıp sonra detaylara inebileceğin, yarı poster yarı mini ders notu gibi bir yapı var.

1) Dersin Büyük Resmi

Bilgisayar sistemlerinin temel mantığı: veri işlenir, saklanır, taşınır ve tüm bu süreç kontrol edilir. Geri kalan her şey bu dört temel fikrin katman katman büyümüş hali gibi düşünülebilir.

Core Function

Data Processing

ALU; toplama, çıkarma, karşılaştırma, mantıksal işlemler ve bazı veri manipülasyonlarını yürütür.

Daha fazla detay

İşlemci açısından “işleme” sadece matematik değildir. Karşılaştırma, bit düzeyinde AND/OR/XOR, shift işlemleri ve koşul kontrolü de veri işleme kapsamına girer. Programın karar verme kabiliyeti büyük ölçüde bu operasyonlara dayanır.

Core Function

Data Storage

Veri farklı hız ve kapasite seviyelerinde tutulur: register, cache, RAM, disk.

Neden tek tür bellek yok?

Çünkü tek bir teknoloji hem çok hızlı, hem çok büyük, hem de ucuz olamıyor. O yüzden bellek hiyerarşisi kurulur. En hızlı katmanlar küçük ve pahalı, en büyük katmanlar ise daha yavaş olur.

Core Function

Data Movement

CPU, memory ve I/O arasında sürekli veri akar. Bus yapısı bu akışın omurgasıdır.

Pratikte ne anlama gelir?

Bir komutun çalışması bile çoğu zaman veri hareketi içerir: komut bellekten çekilir, veri register’a alınır, sonuç tekrar register’a veya belleğe yazılır. İşlem kadar taşıma da önemlidir.

Core Function

Control

Control Unit; hangi birimin, hangi sırayla, hangi sinyallerle çalışacağını yönetir.

Control Unit neden kritik?

ALU tek başına ne yapacağını bilmez. Bellek de hangi adrese erişeceğini kendi karar vermez. Komutlar çözülür, mikro seviyede kontrol sinyallerine dönüştürülür ve sistem senkron biçimde ilerler.

2) Mimari vs Organizasyon

Bu ikisini karıştıran hoca sorusunda ilk çukura düşer. Birisi dışarıdan görünen davranış, diğeri içerideki uygulama yöntemidir.

Architecture Programcıya görünen özelliklerdir: instruction set, adresleme teknikleri, veri bit uzunluğu, I/O davranışı gibi.
Organization Bu özelliklerin içeride nasıl uygulandığıdır: control signal yapısı, donanım birimleri, memory technology, interconnection detayları.
Neden önemli? Aynı mimariyi paylaşan iki işlemci, farklı organizasyon kullansa bile aynı yazılımı çalıştırabilir. Kod uyumluluğu burada doğar.

3) Bilgisayarın Evrimi

ENIAC’tan modern çok çekirdekli sistemlere kadar gelişim çizgisi aslında tek bir hikâye anlatır: daha küçük transistör, daha yüksek entegrasyon, daha fazla paralellik.

1

ENIAC

Vakum tüplü, devasa, çok enerji tüketen ve manuel programlanan ilk dönem elektronik bilgisayar.

Detay aç

ENIAC, stored-program mantığı öncesi bir dönem örneğidir. Programı değiştirmek fiziksel ayarları değiştirmeyi gerektirebiliyordu. Bu da esneklik açısından büyük sınırlamaydı.

2

von Neumann

Program ve verinin aynı ana bellekte tutulduğu stored-program yaklaşımı modern bilgisayarın temelini attı.

Neden devrimdi?

Artık donanımı fiziksel olarak yeniden düzenlemek yerine yeni komut dizisi belleğe yüklenebiliyordu. Bu, genel amaçlı bilgisayar kavramını ciddi biçimde güçlendirdi.

3

Transistör

Vakum tüplerinin yerini aldı; sistemleri küçülttü, ucuzlattı ve daha güvenilir hale getirdi.

Etkileri
  • Daha az ısı üretimi
  • Daha düşük güç tüketimi
  • Daha yüksek güvenilirlik
  • Daha küçük fiziksel boyut
4

Mikroişlemci

CPU bileşenlerinin tek çipte toplanması kişisel bilgisayar devrimine kapı açtı.

Daha fazla detay

Intel 4004 ve sonrası, CPU’yu fiziksel olarak küçültürken performansın sürekli artırılabilmesini sağladı. Bu çizgi sonradan x86 ailesini, PC ekosistemini ve kitlesel bilgisayarı büyüttü.

5

Çok Çekirdek

Clock hızını sonsuza kadar artırmak mümkün olmayınca çözüm paralellik ve çok çekirdek oldu.

Neden zorunlu hale geldi?

Isı, güç yoğunluğu, RC delay ve memory latency sorunları tek çekirdeği sürekli hızlandırma fikrini sınırladı. Bu yüzden modern tasarım daha çok paralellik odaklıdır.

4) Üst Düzey Bilgisayar Şeması

Bu, sistemin kuş bakışı görünümü. CPU ortadaki beyin gibi görünür ama memory ve I/O olmadan yalnız başına çok bir şey yapamaz.

Input / Output
Klavye, disk, ağ kartı, ekran, sensörler, çevre birimleri
System Bus
Data Bus
Address Bus
Control Bus
Main Memory
Komutlar ve veriler geçici olarak burada tutulur
CPU
Control Unit + ALU + Registers
Control Unit
Komutları çözer, kontrol akışını yönetir, sinyal üretir.
ALU
Veri işleme çekirdeğidir. Arithmetic ve logic operasyonları yapar.
Registers
CPU içindeki en hızlı depolama alanıdır. Çok küçük ama çok kritik.
Bu şemanın mantığını daha derin açıkla

CPU, ana bellekten komut ve veri çeker; I/O modülleriyle doğrudan değil çoğu zaman I/O denetleyicileri üzerinden haberleşir. Bus, bu birimlerin ortak iletişim altyapısıdır. Ancak tüm birimler aynı yolu kullandığı için zamanlama ve arbitration kritik hale gelir.

5) Instruction Cycle

İşlemcinin temel ritmi fetch → decode → execute mantığıdır. Bazı anlatımlarda fetch ve execute iki ana adım olarak geçer; decode de execute öncesi yorumlama safhası olarak düşünülür.

1

PC

Program Counter sıradaki komutun adresini tutar.

PC neden bu kadar önemli?

PC olmasa işlemci sıradaki komutun nerede olduğunu bilemez. Normal akışta artar, jump/branch/interrupt gibi olaylarda farklı adrese güncellenir.

2

Fetch

Komut, memory’den alınır ve IR içine yüklenir.

Fetch sırasında neler olur?
  • PC’deki adres memory’e gönderilir
  • Komut veri yoluyla CPU’ya gelir
  • Instruction Register içine konur
  • Normal durumda PC bir sonraki komutu gösterecek şekilde ilerler
3

Decode

Control Unit komutu yorumlar, hangi kaynakların kullanılacağını belirler.

Decode aşamasında ne çözülür?

Komut tipi, kaynak register’lar, hedef register, gerekli ALU işlemi, bellek erişimi gerekip gerekmediği ve kontrol akışının değişip değişmeyeceği bu aşamada anlaşılır.

4

Execute

ALU işlem yapar, veri taşınır, memory/I/O erişimi gerçekleşir veya branch uygulanır.

Execute tek tip midir?

Hayır. Bazı komutlar veri taşır, bazıları aritmetik yapar, bazıları koşul kontrol eder, bazıları I/O ile haberleşir. “Execute” genel isimdir; içeriği komut tipine göre değişir.

6) Interrupt Mekanizması

CPU her şeyi sırayla yaparken bazen dışarıdan ya da içeriden “acil bakman gereken bir şey var” sinyali gelir. İşte buna interrupt deriz.

Interrupt Türleri

Farklı kaynaklar farklı türde kesme üretebilir. Sınavda genelde türleri ve örnekleri sorulur.

Program interrupt

Overflow, division by zero veya illegal instruction gibi durumlar programın çalışma bağlamından doğar.

Timer interrupt

İşletim sistemlerinin zaman paylaşımlı çalışmasında kritik rol oynar. CPU’nun tek bir süreçte sonsuza kadar kalmasını engeller.

I/O interrupt

Disk okuma tamamlandığında ya da klavyeden veri geldiğinde CPU’ya haber verilir. Böylece CPU sürekli polling yapmaz.

Hardware failure

Memory parity error gibi donanımsal sorunlar kritik olabilir. Sistem güvenliği ve hata yönetimi için önemlidir.

Interrupt Döngüsü

Interrupt geldiğinde işlemci aniden her şeyi unutmaz; kontrollü bir geçiş yapar.

1. Interrupt kontrol edilir

İşlemci, instruction cycle içerisinde belirli noktalarda interrupt pending olup olmadığını denetler.

2. Context save yapılır

PC, register değerleri ve gerekiyorsa status bilgileri saklanır. Bu, daha sonra programa kaldığı yerden dönebilmek için gereklidir.

3. Handler routine çalışır

Interrupt türüne karşılık gelen servis rutini çalıştırılır. Bu rutin sorunu işler ya da I/O olayını tamamlar.

4. Restore ve geri dönüş

Kaydedilen durum geri yüklenir ve CPU, asıl programa kaldığı noktadan devam eder.

Multiple Interrupts

Bir interrupt işlenirken başka interrupt’ler de gelebilir. Bu durumda iki temel strateji vardır: ya geçici olarak diğerleri engellenir ya da öncelik sistemi kullanılır.

Sequential handling

Bir interrupt işlenirken yenileri bekler. Sırayla ele alınırlar. Tasarımı daha basit ama kritik olaylara tepki süresi daha yavaş olabilir.

Nested interrupts

Düşük öncelikli bir interrupt işlenirken daha yüksek öncelikli bir interrupt araya girebilir. Bu, gerçek zamanlılık açısından avantajlıdır ama kontrol akışını karmaşıklaştırır.

Interrupts neden verim sağlar?

I/O işlemleri CPU’ya göre yavaştır. CPU her seferinde hazır mı diye sormak yerine başka iş yapar, iş bitince I/O modülü interrupt yollar.

Polling ile farkı

Polling’de CPU sürekli cihazı kontrol eder. Interrupt yaklaşımında ise cihaz hazır olduğunda CPU’ya haber verir. Bu, işlemci zamanının daha verimli kullanılmasını sağlar.

7) Bus Sistemi

Bus, cihazlar arasında veri, adres ve kontrol sinyallerini taşıyan ortak iletişim yoludur. Mantık basit görünür ama performans ve koordinasyon açısından çok hassastır.

Bus Type

Data Bus

Veriyi taşır. Genişlik arttıkça bir çevrimde taşınan veri miktarı artar.

Daha detaylı

8, 16, 32 veya 64 bit veri yolu; aynı anda taşınabilecek veri hacmini etkiler. Ancak toplam performans yalnızca genişliğe değil, bus frekansına ve protokol tasarımına da bağlıdır.

Bus Type

Address Bus

Verinin hangi adrese gideceğini ya da nereden geleceğini belirtir.

Adres genişliği neyi belirler?

Adres yolu genişliği, teorik olarak erişilebilecek adres uzayını belirler. Örneğin 16 bit adres yolu, 2¹⁶ farklı adresi temsil edebilir.

Bus Type

Control Bus

Read/write, interrupt request, acknowledge, timing ve clock gibi sinyalleri taşır.

Neden ayrı tutulur?

Veri nereye gidecek ve ne taşınacak sorularına ek olarak, “hangi işlem yapılacak ve ne zaman yapılacak” bilgisi de gerekir. Control bus tam bunu sağlar.

Single Bus Problemleri

Herkesi tek otobana sokarsan trafik olur. Aynı fikir burada da geçerli.

Propagation delay

Bus üzerindeki fiziksel yollar uzadıkça sinyal yayılım gecikmesi artar. Bu, yüksek hızlarda daha büyük problem olur.

Bus contention

Birden fazla cihaz aynı anda bus’ı kullanmak istediğinde bekleme oluşur. Performans doğrudan etkilenir.

Çözüm

Modern sistemler çoğu zaman hiyerarşik, çok katmanlı veya farklı amaçlara ayrılmış çoklu bus yapıları kullanır.

Bus Arbitration

Aynı anda sadece bir modül bus’ı kontrol edebilir. Kimin kullanacağına karar verme işine arbitration denir.

Centralized arbitration

Tek bir arbiter ya da bus controller, erişimi kimin alacağını belirler. Tasarımı nettir ama merkezi yapıya bağımlıdır.

Distributed arbitration

Her modül kendi mantığıyla erişim isteyebilir. Daha dağıtık yapı sunar ama kontrol mekanizması modüller arasında paylaşılır.

DMA neden burada geçer?

DMA controller da bus master olabilir. Bu yüzden CPU dışında başka birimlerin de bus’ı talep etmesi arbitration konusunu doğurur.

Synchronous vs Asynchronous Timing

Zamanlama, bus üzerindeki işlemlerin koordinasyon şeklidir.

Synchronous timing

Tüm modüller ortak saat sinyaline göre hareket eder. Tasarım net ve yüksek hız için uygundur ancak tüm bileşenlerin bu saat düzenine uyumlu olması gerekir.

Asynchronous timing

Hazır olma durumu el sıkışma benzeri sinyallerle belirlenir. Farklı hızdaki cihazları bağlamakta esnek olabilir ama kontrol daha karmaşıktır.

Dedicated vs Multiplexed Bus

Bazı sistemler adres ve veriyi ayrı hatlarda taşır, bazıları aynı hatları zaman paylaşımlı kullanır.

Dedicated bus

Ayrı address ve data line kullanılır. Performans açısından avantajlı olabilir ama daha fazla fiziksel hat gerekir.

Multiplexed bus

Aynı hatlar bazen adres bazen veri taşır. Hat sayısı azalır ama zamanlama ve kontrol mantığı daha karmaşık hale gelir.

8) Memory Hierarchy ve Cache Memory

CPU çok hızlı, ana bellek daha yavaş. Cache bu ikisinin arasına girip beklemeyi azaltan ultra önemli ara katmandır.

RegistersEn hızlı • En küçük • CPU içinde
L1 CacheÇok hızlı • Çok küçük • Genelde çekirdeğe çok yakın
L2 CacheDaha büyük • Biraz daha yavaş • Orta tampon bölge
L3 CacheDaha büyük • Çoğu sistemde paylaşımlı olabilir
Main Memory (RAM)Büyük • Cache’ten yavaş
Disk / SSD / External StorageEn büyük • Çok daha yavaş • Kalıcı depolama
Bu hiyerarşinin mantığı

Yukarı çıktıkça erişim süresi azalır ama kapasite küçülür ve maliyet artar. Aşağı indikçe depolama büyür ama hız düşer. Cache, bu yüzden CPU ile RAM arasındaki boşluğu pratik olarak kapatmaya çalışır.

9) Locality of Reference

Cache’in çalışmasını mümkün kılan sihir bu değil ama baya yakın bir şey: programlar bellek erişimlerini kümeli yapma eğilimindedir.

Temporal Locality

Az önce kullanılan veri veya komutun yakın zamanda tekrar kullanılma olasılığı yüksektir.

Örnek

Bir döngü içindeki sayaç değişkeni veya aynı fonksiyonun sık kullanılan komutları tekrar tekrar erişilebilir.

Spatial Locality

Bir adrese erişildiyse çevresindeki adreslere de yakın zamanda erişme ihtimali yüksektir.

Örnek

Diziler üzerinde sırayla dolaşmak veya komutların bellek içinde ardışık yer alması buna tipik örnektir. Bu yüzden cache line tek bir word değil, bir blok taşır.

10) Cache Nasıl Çalışır?

Mantık basit: önce cache’e bak. Varsa hızlıca kullan, yoksa RAM’den getir ve cache’e koy.

1

CPU Request

İşlemci bir memory adresine erişmek ister.

2

Tag Check

İlgili cache line veya set içinde tag karşılaştırılır.

3

Cache Hit

Veri cache’de bulunursa CPU doğrudan hızlı erişim yapar.

4

Cache Miss

Veri yoksa ana bellekten blok çekilir.

5

Fill + Serve

Blok cache’e yerleştirilir ve sonra CPU’ya servis edilir.

Hit Ratio
Toplam erişimlerin ne kadarının cache’de bulunduğunu gösterir. Ne kadar yüksekse o kadar iyi.
Miss Penalty
Cache miss olduğunda ödenen ekstra gecikme maliyetidir. RAM’e gidip dönmek pahalıdır.
Tag
Bir cache line’daki verinin ana bellekte hangi bloğa ait olduğunu belirlemek için tutulur.

11) Cache Mapping Türleri

Ana bellekteki blokların cache’e nasıl yerleştirileceği hit oranını, donanım karmaşıklığını ve maliyeti doğrudan etkiler.

Direct Mapping

Her main memory block, cache’de yalnızca tek bir line’a gidebilir.

Adres alanları

Adres genelde tag + line + word olarak düşünülür. Line alanı hangi cache slotuna bakılacağını söyler; tag ise o slotta doğru blok olup olmadığını kontrol eder.

Avantajlar
  • Basit tasarım
  • Düşük maliyet
  • Hızlı line seçimi
Dezavantajlar

Aynı line’a denk gelen iki blok sırayla erişiliyorsa sürekli birbirini dışarı atabilir. Bu durum miss oranını gereksiz artırır.

Fully Associative Mapping

Her blok, cache’de herhangi bir line’a yerleştirilebilir.

Nasıl aranır?

Her line’daki tag alanı gelen adresin tag’iyle karşılaştırılır. Yani arama daha esnektir ama donanım maliyeti yüksektir.

Avantajlar
  • Conflict miss çok azalır
  • Esnek yerleştirme sağlar
Dezavantajlar

Tüm line’lar üzerinde karşılaştırma gerekebilir. Bu da donanımı pahalı ve karmaşık yapar.

Set Associative Mapping

Cache set’lere bölünür. Her blok yalnızca belirli bir set’e gider ama o set içindeki herhangi bir line’da tutulabilir.

Neden en yaygın çözüm?

Direct mapping kadar katı değildir, fully associative kadar pahalı değildir. Yani performans ve maliyet arasında çok tatlı bir orta yol sunar.

2-way / 4-way ne demek?

Bir sette kaç line bulunduğunu gösterir. 2-way set associative yapıda, aynı sete düşen bir blok iki farklı satırdan birine yerleşebilir.

Victim Cache

Özellikle direct-mapped cache’in attığı blokları kısa süreli tutan küçük bir ara cache yapısıdır.

Neden işe yarar?

Az önce atılan veri hemen tekrar lazım olursa, doğrudan RAM’e gitmek yerine victim cache’den alınabilir. Bu, miss penalty’yi azaltabilir.

12) Replacement Algorithms

Cache doluysa ve yeni blok gelecekse, hangisi çıkarılacak? Oyun burada stratejiye dönüyor.

LRU

En uzun süredir kullanılmayan blok çıkarılır.

Artı / Eksi

Locality ile iyi uyum sağlar ama gerçek donanımda tam LRU takibi pahalı olabilir.

FIFO

İlk giren ilk çıkar. Basit ama her zaman en akıllı seçim olmayabilir.

Ne zaman mantıklı?

Uygulaması daha kolaydır. Bazı sistemlerde donanım basitliği performans kaybından daha değerli görülebilir.

LFU

En az kullanılan blok çıkarılır.

Sorun ne?

Geçmiş popülerliği yüksek olan bir blok, artık gereksiz hale gelmiş olsa bile tutulabilir. Sayaç takibi de ek maliyet getirir.

Random

Rastgele bir blok çıkarılır. Basit ama biraz kaderci.

Neden yine de kullanılır?

Bazı donanımlarda çok düşük ek maliyetle kabul edilebilir sonuçlar verdiği için tercih edilebilir.

13) Write Policy

CPU veri yazdığında cache ile ana bellek nasıl senkron kalacak? İşte klasik write-through vs write-back kapışması.

Write Through

  • Yazma hem cache’e hem main memory’ye gider
  • Main memory her zaman daha güncel olur
  • Çok işlemcili ve I/O senaryolarında yönetim daha nettir
  • Dezavantaj: fazla trafik ve daha yavaş write
Daha derin açıklama

Write-through, doğruluk ve görünürlük açısından rahattır çünkü main memory geri kalmaz. Ancak her yazmada aşağı seviyeye gitmek gerektiği için bant genişliği tüketimi artar.

Write Back

  • İlk güncelleme yalnızca cache’de yapılır
  • Dirty bit ile değiştirilmiş line işaretlenir
  • Line çıkarılırken gerekirse main memory’ye yazılır
  • Avantaj: daha hızlı yazma ve daha az trafik
Daha derin açıklama

Write-back performans açısından güzeldir çünkü çok sayıdaki ardışık yazma ana belleğe ayrı ayrı gönderilmez. Fakat cache coherence ve I/O görünürlüğü tarafında daha dikkatli tasarım ister.

14) Block Size ve Multilevel Cache

Cache sadece “var mı yok mu” meselesi değildir. Kaç byte’lık blok çekileceği ve kaç katman olacağı da performansı ciddi etkiler.

Block Size

Cache, yalnızca istenen word’ü değil komşu verileri de çekebilir. Çünkü spatial locality çoğu zaman işe yarar.

Neden büyük blok bazen iyi?

Tek seferde daha fazla komşu veri getirildiği için bir sonraki erişimler hit olabilir. Özellikle ardışık veri erişimlerinde faydalıdır.

Neden fazla büyük blok kötü olabilir?

Gereksiz veri taşınır, cache’e daha az blok sığar ve faydalı başka line’lar dışarı atılabilir. Yani her büyütme iyi değildir.

Multilevel Cache

L1, L2, L3 gibi katmanlar, hız-kapasite dengesini optimize etmeye çalışır.

L1 neden küçük?

Çekirdeğe çok yakın konumlandırıldığı ve en hızlı seviye olduğu için fiziksel olarak küçük tutulur. Ama erişim gecikmesi çok düşüktür.

L2 ve L3’ün rolü

L2 ve L3, miss durumunda RAM’e gitmeden önce ikinci ve üçüncü savunma hattı gibi çalışır. Daha büyük oldukları için daha çok veri tutarlar ama L1 kadar hızlı değildirler.

15) Performance, Clock ve Amdahl’s Law

Performans sadece GHz değildir. Memory latency, cache yapısı, instruction-level parallelism ve yazılımın paralelleşebilirliği de çok önemlidir.

Clock Speed Neden Her Şey Değil?

Yüksek saat frekansı tek başına hızlı sistem demek değildir.

Sebep 1: Memory Wall

CPU hızlı olsa da veri RAM’den geç geliyorsa beklemek zorunda kalır. Cache bu yüzden çok önemlidir.

Sebep 2: Pipeline ve IPC

Bir çevrimde kaç iş yapıldığı da kritiktir. Aynı GHz’de iki işlemci, farklı iç organizasyonları nedeniyle çok farklı sonuçlar verebilir.

Sebep 3: Branch ve stall

Yanlış branch prediction, cache miss veya data hazard gibi durumlar işlem hattını bekletebilir. Kâğıt üzerindeki hız pratikte düşer.

Amdahl’s Law

Programın yalnızca paralelleştirilebilen kısmı hızlanır. Seri kalan bölüm, toplam speedup’ı sınırlar.

Speedup ≤ 1 / (1 - f)
Bu formül ne anlatıyor?

Eğer kodun yalnızca küçük bir bölümü paralelse, 8 çekirdek, 16 çekirdek hatta teorik sonsuz çekirdek bile sınırlı fayda sağlar. Bu yüzden yazılım yapısı donanım kadar önemlidir.

16) Hızlı Ezber Kutuları

Architecture vs Organization

  • Architecture = dışarıdan görünen özellikler
  • Organization = içeride nasıl uygulandığı
  • Aynı mimari, farklı organizasyon olabilir

Instruction Cycle

  • PC adresi tutar
  • Fetch ile komut alınır
  • Decode ile yorumlanır
  • Execute ile uygulanır

Interrupt

  • Normal akış geçici kesilir
  • Context save edilir
  • Handler çalışır
  • Restore edilip dönülür

Bus

  • Data bus veri taşır
  • Address bus hedefi söyler
  • Control bus işlemi ve zamanı belirtir

Cache

  • CPU ile RAM arasındaki hızlı tampon
  • Locality of reference sayesinde etkili
  • Hit iyi, miss pahalı

Write Policies

  • Write-through = anında RAM’e de yaz
  • Write-back = önce cache, sonra gerekince RAM
  • Trade-off = doğruluk kolaylığı vs performans

17) Mini Sınav Soruları

Bunları açıp bakarak kendini test edebilirsin. Cevaplar içinde saklı.

1. What is the difference between computer architecture and computer organization?

Computer architecture refers to the attributes of a computer that are visible to the programmer, such as the instruction set, data formats, addressing modes, and I/O mechanisms. Computer organization refers to how those architectural features are implemented internally, such as control signals, hardware units, memory technology, and internal data paths. For example, a multiply instruction is part of architecture, but whether multiplication is done by a dedicated hardware unit or repeated addition is part of organization.

2. What are the four basic functions of a computer system?

The four basic functions are data processing, data storage, data movement, and control. Data processing means performing arithmetic or logical operations, such as adding two numbers. Data storage means holding data temporarily or permanently, such as saving a file in memory or on disk. Data movement means transferring data between components, such as reading input from a keyboard. Control means directing the sequence of operations, such as the Control Unit deciding which instruction to execute next.

3. What do structure and function mean in computer organization?

Structure refers to the way the components of a computer are arranged and interconnected, such as the relationship between the CPU, memory, and I/O modules. Function refers to what each component does as part of the overall system. For example, the CPU processes data, memory stores programs and data, and I/O modules communicate with external devices.

4. Why is ENIAC considered an important milestone in computer history?

ENIAC is considered an important milestone because it was one of the first large-scale general-purpose electronic computers. It used about 18,000 vacuum tubes, consumed a great deal of power, and could perform thousands of additions per second. Although it was programmed manually with switches and cables and used decimal rather than binary representation, it showed that high-speed electronic computation was possible and helped begin the modern computer era.

5. What is the stored-program concept?

The stored-program concept means that both instructions and data are stored in main memory. This is important because the computer can fetch instructions directly from memory and execute them in sequence without being physically rewired for each new task. It made computers flexible, programmable, and capable of running many different applications using the same hardware.

6. What are the main components of a von Neumann machine?

The main components of a von Neumann machine are the CPU, main memory, input/output equipment, and the interconnection between them. The CPU itself includes the Arithmetic Logic Unit and the Control Unit. This model is important because it introduced the stored-program concept and became the foundation for most modern computer systems.

7. In what ways did the IAS computer influence modern processor design?

The IAS computer influenced modern processor design by showing how a stored-program computer could be organized around memory, registers, and a Control Unit. It used registers such as the Program Counter, Instruction Register, and Accumulator, which became standard concepts in later CPUs. Its structure helped establish the basic fetch-decode-execute model used in modern processors.

8. How did the transitions from vacuum tubes to transistors and then to microprocessors affect computer development?

The move from vacuum tubes to transistors made computers smaller, cheaper, more reliable, and less power-hungry. The later development of microprocessors placed the CPU on a single chip, which greatly reduced size and cost while increasing speed and availability. These transitions made computers practical for business, personal, and embedded use.

9. What is Moore’s Law?

Moore’s Law states that the number of transistors on a chip tends to double approximately every 18 to 24 months. This trend enabled processors to become more powerful, smaller, and cheaper over time. It supported major advances in computing performance, cache size, integration level, and system complexity.

10. Why can processor performance not be evaluated only by clock speed?

Clock speed alone does not determine processor performance because performance also depends on instruction-level parallelism, cache efficiency, pipeline design, branch prediction, memory latency, and the number of instructions completed per cycle. A processor with a lower clock speed can outperform a faster one if its architecture and organization are more efficient.

11. Why is the speed gap between processor and memory a major problem in computer systems?

The speed gap between processor and memory is a major problem because modern CPUs can execute instructions much faster than main memory can supply data. As a result, the processor may spend significant time waiting for memory accesses to complete. This reduces overall system performance and creates a bottleneck often called the memory wall.

12. What solutions have been developed to reduce the performance gap between the processor and memory?

Several solutions have been developed, including cache memory, wider memory transfers, improved DRAM interfaces, higher-bandwidth interconnections, multilevel caches, and better memory hierarchies. These techniques reduce average memory access time and help the CPU get data more quickly.

13. What is pipelining?

Pipelining is a technique in which instruction execution is divided into stages, and different instructions are processed simultaneously in different stages. It improves performance by increasing throughput, meaning more instructions can be completed in a given time, even though the execution time of a single instruction may not decrease.

14. What does superscalar processing mean?

Superscalar processing means that a processor can issue and execute multiple instructions in parallel during the same clock cycle. It is related to pipelining because it usually uses multiple pipelines or multiple execution units, allowing more than one instruction to move through the processor at once.

15. Why did computer designers begin to prefer multi-core processors?

Designers began to prefer multi-core processors because increasing clock speed further caused major problems such as high power consumption, heat generation, and physical design limits. By placing multiple cores on one chip, designers could improve performance through parallel execution without relying only on higher clock rates.

16. What is Amdahl’s Law?

Amdahl’s Law states that the overall speedup of a program is limited by the portion of the program that cannot be parallelized. It is important in multiprocessor systems because it shows that adding more processors does not lead to unlimited performance improvement. The serial part of a program always places a limit on total speedup.

17. What are embedded systems?

Embedded systems are computer systems designed to perform specific dedicated functions within larger devices, such as cars, washing machines, medical devices, or phones. They differ from general-purpose computers because they are optimized for specific tasks, often with constraints such as low power use, real-time response, reliability, and small size.

18. Why is ARM architecture widely used in embedded systems?

ARM architecture is widely used in embedded systems because it offers high performance with low power consumption, small chip area, and efficient design. These features make it ideal for battery-powered and space-constrained devices such as smartphones, tablets, and embedded controllers.

19. What is a program from the computer’s point of view?

From the computer’s point of view, a program is a sequence of coded instructions stored in memory. Each instruction tells the system what operation to perform. The Control Unit reads these instructions, interprets them, and generates the control signals needed to carry out the required actions in the CPU, memory, and I/O system.

20. How does the Control Unit work?

The Control Unit works by fetching an instruction from memory, decoding it, and generating the control signals that direct other parts of the computer. These signals may cause data to be moved, arithmetic operations to be performed, memory to be read or written, or program flow to change. In this way, the Control Unit turns instructions into actual hardware actions.

21. What are the main parts of a CPU?

The main parts of a CPU are the Control Unit, the Arithmetic Logic Unit, registers, and internal interconnections. The Control Unit directs operations, the ALU performs arithmetic and logical operations, registers store small amounts of fast data and instructions, and the internal interconnections allow data and control information to move between CPU components.

22. What is the instruction cycle?

The instruction cycle is the basic process a CPU follows to execute each instruction. Its main stages are fetch, decode, and execute. In the fetch stage, the instruction is read from memory. In the decode stage, the Control Unit interprets the instruction. In the execute stage, the required action is performed, such as computation, data transfer, or control flow change.

23. What are the functions of the Program Counter (PC) and the Instruction Register (IR)?

The Program Counter stores the address of the next instruction to be fetched from memory. The Instruction Register holds the instruction that has just been fetched and is currently being decoded or executed. Together, they help the CPU keep track of program flow and current operations.

24. What happens during the fetch cycle?

During the fetch cycle, the processor uses the address in the Program Counter to read the next instruction from memory. The instruction is then loaded into the Instruction Register, and the Program Counter is updated to point to the next instruction unless a later control operation changes it.

25. What kinds of operations can occur during the execute cycle?

During the execute cycle, several kinds of operations can occur, including data transfer between CPU and memory, data transfer between CPU and I/O, arithmetic or logical processing in the ALU, and control operations such as branching or jumping to a different instruction address.

26. What is an interrupt?

An interrupt is a signal that causes the processor to temporarily stop its current sequence of instruction execution in order to respond to an event that needs attention. It affects normal program flow by suspending the current program, saving its state, running an interrupt service routine, and then restoring the saved state so execution can continue.

27. What is the difference between program interrupts, timer interrupts, I/O interrupts, and hardware failure interrupts?

Program interrupts are caused by conditions such as divide-by-zero or overflow during execution. Timer interrupts are generated by an internal clock and are commonly used for multitasking. I/O interrupts are sent by I/O controllers when an input or output operation needs service or has completed. Hardware failure interrupts are caused by physical problems such as memory parity errors.

28. Why does the processor need to save the context when an interrupt occurs?

The processor must save the context so it can return to the interrupted program and continue correctly after the interrupt has been handled. The context includes important information such as the Program Counter, register contents, and processor status, all of which are needed to resume execution without losing the program’s state.

29. What are the two main ways of dealing with multiple interrupts?

The two main ways of dealing with multiple interrupts are sequential handling and priority-based nested handling. In sequential handling, further interrupts are delayed until the current one is finished. In nested handling, higher-priority interrupts are allowed to interrupt lower-priority ones.

30. What is the difference between nested interrupt handling and sequential interrupt handling?

In sequential interrupt handling, the processor finishes servicing one interrupt before beginning another, even if more interrupts are waiting. In nested interrupt handling, a higher-priority interrupt can interrupt the service routine of a lower-priority interrupt. This allows urgent events to be handled more quickly.

31. Why must the CPU, memory, and I/O modules be connected to one another?

The CPU, memory, and I/O modules must be connected so that instructions and data can be transferred between them. The CPU needs to fetch instructions and data from memory, send and receive data to and from I/O devices, and control the operation of the entire system. Without these connections, the system could not function as a complete computer.

32. What is a bus?

A bus is a shared communication pathway that connects two or more computer components. It is essential because it allows data, addresses, and control information to be exchanged among the CPU, memory, and I/O modules in an organized and efficient way.

33. What is the difference between the data bus, address bus, and control bus?

The data bus carries the actual data being transferred. The address bus carries information about the source or destination address of the data. The control bus carries timing and control signals such as read, write, interrupt request, and clock signals. Together, these buses coordinate communication within the system.

34. How does the width of the address bus affect the system?

The width of the address bus determines how many unique memory locations can be addressed. A wider address bus allows the processor to access a larger memory space. For example, a 16-bit address bus can address 2^16 locations.

35. Why can a single-bus structure create performance problems?

A single-bus structure can create performance problems because all components must share the same communication path. If many modules try to use the bus frequently, delays and contention occur. Long data paths and limited bus bandwidth can also reduce performance.

36. What is bus arbitration?

Bus arbitration is the process of deciding which module gets control of the bus when more than one module requests it at the same time. It is necessary because only one module can control a shared bus at a time, and conflicts must be resolved in an orderly way.

37. What is the difference between centralized arbitration and distributed arbitration?

In centralized arbitration, a single controller or arbiter decides which module may use the bus. In distributed arbitration, each module contains logic that helps decide bus access without relying on one central controller. Centralized arbitration is simpler to manage, while distributed arbitration can be more flexible.

38. What is the difference between synchronous bus timing and asynchronous bus timing?

In synchronous bus timing, events are coordinated by a shared clock signal, and all modules follow the same timing pattern. In asynchronous bus timing, transfers use control signals and handshaking instead of a common clock, allowing devices with different speeds to communicate more flexibly.

39. What is the memory hierarchy?

The memory hierarchy is the arrangement of storage levels according to speed, cost, and capacity. From fastest and smallest to slowest and largest, the levels typically include registers, cache memory, main memory, and secondary storage such as SSDs or hard disks. The logic is to keep frequently used data in faster but smaller memory and less frequently used data in slower but larger storage.

40. Why do we not build a computer using only very fast memory everywhere?

We do not build a computer using only very fast memory everywhere because very fast memory, such as static RAM, is expensive and takes more chip area. Using it for the entire system would be impractical and too costly. Instead, systems use a hierarchy that balances speed, cost, and capacity.

41. What is locality of reference?

Locality of reference is the tendency of programs to access the same memory locations or nearby locations repeatedly over short periods of time. It is important for cache memory because cache works best when recently used or nearby data is likely to be needed again, which increases the hit rate and reduces average access time.

42. What is the difference between temporal locality and spatial locality?

Temporal locality means that a memory location that was accessed recently is likely to be accessed again soon. For example, a loop counter variable is used repeatedly during a loop. Spatial locality means that if one memory location is accessed, nearby locations are likely to be accessed soon as well. For example, reading elements of an array in order shows spatial locality.

43. What is cache memory?

Cache memory is a small, fast memory placed between the CPU and main memory. Its role is to store copies of frequently used instructions and data so the processor can access them more quickly than if it had to go to main memory each time. This reduces average memory access time and improves performance.

44. What is the difference between a cache hit and a cache miss?

A cache hit occurs when the requested data is found in cache, allowing fast access. A cache miss occurs when the data is not in cache and must be fetched from main memory, which is slower. They are important because system performance depends heavily on how often the CPU can find data in cache instead of waiting for main memory.

45. Why is the mapping function important in cache design?

The mapping function is important because it determines where a block of main memory may be placed in the cache. It affects hardware complexity, hit rate, conflict behavior, and overall cache performance. Choosing the right mapping method is a key part of cache design.

46. How does direct mapping work?

In direct mapping, each block of main memory can be placed in only one specific cache line. The cache line is determined by part of the memory address, and the tag field is used to check whether the correct block is present. Its advantages are simplicity, low cost, and fast access. Its main disadvantage is that different memory blocks that map to the same cache line can repeatedly replace each other, causing frequent misses.

47. How does fully associative mapping work?

In fully associative mapping, any block of main memory can be placed in any cache line. To find a block, the cache must compare the requested tag with the tags of all cache lines. It is more expensive because this requires more complex hardware for parallel tag comparison and more complicated replacement decisions.

48. Why is set-associative mapping considered a balance between direct mapping and fully associative mapping?

Set-associative mapping is considered a balance because each main memory block maps to a specific set, but within that set it may be placed in any of several lines. This reduces the conflict problems of direct mapping while avoiding the high hardware cost of fully associative mapping. It offers a practical trade-off between complexity and performance.

49. Why are replacement algorithms necessary in cache memory?

Replacement algorithms are necessary because when a cache set is full and a new block must be loaded, the system must decide which existing block to remove. LRU removes the block that has not been used for the longest time and often performs well because of locality. FIFO removes the block that has been in cache the longest, regardless of recent use. Random chooses a block at random and is simple to implement, though usually less predictable in performance.

50. What is the difference between write-through and write-back?

In write-through, every write updates both the cache and main memory immediately. In write-back, updates are made only in the cache at first, and main memory is updated later when the modified block is replaced. Write-back can be faster because it reduces the number of writes to main memory, lowering memory traffic and improving performance.

51. What is a dirty bit?

A dirty bit is a status bit associated with a cache line that indicates whether the data in that line has been modified since it was loaded from main memory. In the write-back policy, the dirty bit tells the system whether the cache block must be written back to main memory before being replaced.

52. Why is cache block size important?

Cache block size is important because it affects locality, hit rate, and cache efficiency. If the block size is too small, the cache may not take full advantage of spatial locality. If it is too large, fewer blocks fit in the cache, more unnecessary data may be loaded, and useful blocks may be replaced too quickly. A good block size balances these effects.

53. Why were multilevel caches developed?

Multilevel caches were developed to balance speed, size, and cost more effectively. L1 cache is the smallest and fastest, located closest to the CPU core. L2 cache is larger and slower than L1, serving as a backup when data is not found in L1. L3 cache is larger still and often shared among cores, helping reduce access to main memory and improving overall performance.

54. What is the difference between a unified cache and a split cache?

A unified cache stores both instructions and data in the same cache, while a split cache uses separate caches for instructions and data. Split cache is more useful in pipelined and high-performance processors because it allows instruction fetch and data access to occur simultaneously without competing for the same cache resource.

55. In modern processors, why must designers carefully balance cache capacity, cache speed, and cost?

Designers must balance cache capacity, cache speed, and cost because a larger cache can improve hit rate, but it also increases chip area, cost, power consumption, and sometimes access time. A very small cache may be fast but ineffective, while a very large cache may be too expensive or too slow. Good processor design requires choosing a cache structure that delivers the best overall performance for practical cost and power limits.

18) Possible Process-Flow Questions Your Instructor May Ask

Some instructors like asking not just definitions but full system flow questions such as “what happens step by step when…” These questions test whether you really understand how the components interact over time.

High Probability

Instruction Execution Flow

Questions about what happens from fetch to execute are the most classic type.

Examples
  • What happens step by step when the CPU executes an instruction?
  • Explain the full flow from Program Counter to execution result.
  • How do the PC, IR, Control Unit, and ALU interact during instruction execution?
High Probability

Interrupt Flow

These questions focus on what happens when normal instruction flow is interrupted by some urgent event.

Examples
  • What happens when an interrupt occurs while a program is running?
  • How does the CPU save context and return to the interrupted program?
  • How are multiple interrupts handled?
High Probability

Cache / Memory Flow

These questions test whether you understand memory hierarchy in action, not just in theory.

Examples
  • What happens when the CPU requests data and it is found in cache?
  • What changes if the data is not found in cache?
  • Explain write-through and write-back as actual flows.
Medium Probability

Bus Communication Flow

These ask how CPU, memory, and I/O exchange data through address, data, and control buses.

Examples
  • How does the CPU read data from main memory through the bus system?
  • How do the data bus, address bus, and control bus work together?
  • What happens when two modules request the bus at the same time?
Medium Probability

Control Unit Flow

These ask how stored instructions become real hardware actions inside the processor.

Examples
  • How does the Control Unit convert an instruction into control signals?
  • How does the CPU know what to do after reading an instruction?
Tricky Style

Why + Flow Combined

These combine process explanation with reasoning, which makes them a little more difficult.

Examples
  • Why is interrupt-driven I/O more efficient than polling? Explain the process.
  • Why can a fast CPU still wait? Explain in terms of cache and memory flow.
  • Why does a single-bus structure reduce performance when many modules are active?

19) Visual Process Flows

Below are graphical step-by-step panels that explain what happens inside the computer during the most likely flow-style questions. These are designed to be easy to follow while studying.

Flow A — Instruction Execution

This is the default life cycle of an instruction during normal program execution.

1

PC Points

The Program Counter stores the address of the next instruction in memory.

2

Fetch

The CPU sends the address to memory and fetches the instruction into the Instruction Register.

3

Decode

The Control Unit interprets the opcode and determines what hardware action is needed.

4

Execute

The ALU, registers, memory, or I/O perform the required action, and then the cycle continues.

Study explanation

This flow is the basis of almost everything in processor behavior. Even more advanced topics like pipelining or superscalar execution are improvements built on top of this same fundamental cycle.

Flow B — Interrupt Handling

This is what happens when the processor must temporarily stop the current program and handle an urgent event.

1

Interrupt Arrives

An interrupt signal is raised by I/O, timer logic, a program exception, or hardware failure.

2

Context Save

The CPU saves important state such as PC and registers so it can return later.

3

Handler Runs

The processor jumps to the interrupt service routine and deals with the event.

4

Resume

The saved state is restored and the interrupted program continues from where it stopped.

Why this matters

Interrupts improve efficiency because the CPU does not need to keep checking devices constantly. Instead, the CPU works on other instructions until something important needs attention.

Flow C — Cache Hit vs Cache Miss

This is one of the most useful process questions because it connects CPU speed, memory hierarchy, and performance.

1. CPU Request
The processor needs an instruction or data item.
2. Cache Lookup
The cache checks tag and line/set information.
3A. Hit
If found, the data is sent quickly to the CPU.
3B. Miss
If not found, the request goes to main memory.
4. Block Transfer
A block containing the required data is brought into cache.
5. CPU Continues
The required data is delivered and execution resumes.
What your instructor may expect

If this comes as an exam question, do not only define hit and miss. Explain the actual sequence: request, lookup, decision, memory access if needed, block placement, and continuation of execution.

Flow D — CPU Reads from Main Memory through the Bus

This is the classic bus interaction story.

1

Address Bus

The CPU places the target memory address on the address bus.

2

Control Bus

The CPU sends a read signal on the control bus.

3

Memory Responds

Main memory retrieves the requested contents from the specified address.

4

Data Bus

The requested data is returned to the CPU on the data bus.

Fast exam tip

When answering bus questions, always mention the three buses by role: address selects location, control specifies operation, data carries the content.

Flow E — Write-Back Cache Replacement

This explains what happens when modified cached data must eventually be written to main memory.

1. CPU Writes
The processor updates data in cache, not immediately in RAM.
2. Dirty Bit Set
The cache line is marked as modified.
3. Cache Keeps Working
Later accesses can still use the updated cache copy quickly.
4. Replacement Needed
When the line must be removed, the cache checks the dirty bit.
5. Write Back
If dirty, the block is written to main memory before replacement.
6. New Block Loaded
The incoming block takes the old line’s place.
Why it is faster than write-through

Because main memory is not updated on every single write. This reduces memory traffic and can improve performance significantly, especially when the same cache block is modified many times.

Flow F — Multiple Interrupts

This is the process version of priority handling.

1

Interrupt A

The CPU begins servicing one interrupt.

2

Interrupt B Arrives

A second interrupt appears while the first one is being handled.

3

Priority Decision

The system either delays B or lets B interrupt A if B has higher priority.

4

Service Order

After the higher-priority work finishes, control returns to the previous interrupt or to the program.

What to mention in an answer

Always mention the difference between sequential handling and nested handling. That is usually the exact conceptual point the instructor wants to hear.